CommonDigits
SRM 128 · 2003-01-06 · by vorthys
Problem Statement
Create a class CommonDigits with a method digit that takes an
Constraints
- num is between 1 and 1000000000, inclusive.
Statement by TopCoder, Inc. — view the original on the archive.
123 Returns: 1
All digits occur the same number of times so return the leftmost.
102030 Returns: 0
79888799 Returns: 9
1 Returns: 1
1000000000 Returns: 0
Submissions are judged against all 31 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class CommonDigits with a public method int digit(int num) · 31 test cases · 2 s / 256 MB per case