Largest 3-Same-Digit Number in String Problem

Largest 3-Same-Digit Number in String Problem — ExecCode Easy DSA Practice

Solve the Largest 3-Same-Digit Number in String problem on ExecCode. Free online easy DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given a string num representing a large integer. Your task is to compute the required answer and return the maximum goodinteger as a string or an empty string "" if no such integer exists. An integer is good if it meets the following conditions: - It is a substring of num with length 3. - It consists of only one unique digit.

Examples

Input {"num": "6777133339"}; Output 777. Input {"num": "2300019"}; Output 000

Constraints

3 <= num.length <= 1000 num only consists of digits.

Practice Largest 3-Same-Digit Number in String free on ExecCode. Browse DSA problems, topic map, and placement guides.