2264. Largest 3-Same-Digit Number in String
You are given a string
numrepresenting a large integer. An integer is good if it meets the following conditions:
- It is a substring of
numwith length3.- It consists of only one unique digit.
Return the maximum good integer as a string or an empty string
""if no such integer exists.Note:
- A substring is a contiguous sequence of characters within a string.
- There may be leading zeroes in
numor a good integer.
1 | class Solution { |