'How to identify repeat number format like 111, 444.xy, 8888 etc

Dear Friends, How to identify the repeat numbers like 111 , Y 122 , N 444 , Y 444.xy , Y # xy is any number 9999 , Y



Solution 1:[1]

Maybe converting the int to a string and going through each character of the string to check if they are all same. But i do also think there may be a better approach to this problem

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eshan