Tap here to switch tabs
Problem
Submissions

Problem: Largest 3-Same-Digit Number in String

med
30 min
Try to solve the Largest 3-Same-Digit Number in String problem.

Statement

You are given a string num representing a large integer. An integer is considered good if it satisfies the following conditions:

  • It is a substring of num of length 33.

  • It consists of only one unique digit.

Return the maximum good integer as a string. If no such integer exists, return an empty string "".

Note: A substring is a contiguous sequence of characters within a string. If multiple good integers exist, compare their numeric values to find the maximum.

Constraints:

  • 3≤3 \leq num.length ≤1000\leq 1000

  • num consists only of digits.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Largest 3-Same-Digit Number in String

med
30 min
Try to solve the Largest 3-Same-Digit Number in String problem.

Statement

You are given a string num representing a large integer. An integer is considered good if it satisfies the following conditions:

  • It is a substring of num of length 33.

  • It consists of only one unique digit.

Return the maximum good integer as a string. If no such integer exists, return an empty string "".

Note: A substring is a contiguous sequence of characters within a string. If multiple good integers exist, compare their numeric values to find the maximum.

Constraints:

  • 3≤3 \leq num.length ≤1000\leq 1000

  • num consists only of digits.