You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 年之前
123456789101112
  1. import sys
  2. from collections import Counter
  3. grid = sys.stdin.read().splitlines()
  4. transpose = list(zip(*grid))
  5. ans1 = ''.join(Counter(line).most_common()[0][0] for line in transpose)
  6. print(ans1)
  7. ans2 = ''.join(Counter(line).most_common()[-1][0] for line in transpose)
  8. print(ans2)