245일차 - BOJ no.2204

https://www.acmicpc.net/problem/2204

My Solution

import sys

while True:
    n = int(sys.stdin.readline().rstrip())
    if n == 0:
        break
    arr = []
    for _ in range(n):
        arr.append(sys.stdin.readline().rstrip())

    temp = []
    for i in arr:
        temp.append(i.lower())
    temp.sort()
    result = temp[0]
    for i in arr:
        if result == i.lower():
            print(i)

좋은 웹페이지 즐겨찾기