fork(1) download
  1. #!/usr/bin/env python3
  2. from collections import Counter
  3.  
  4. numbers = (int(input()) for _ in range(int(input())))
  5. digit_counts = Counter(d for n in numbers for d in str(n)).items()
  6. print(max(digit_counts, key=lambda d_c: (d_c[1], d_c[0]))[0])
Success #stdin #stdout 0.04s 9448KB
stdin
3
123
301
100
stdout
1