본문 바로가기
python-algorithm

백준 1235 학생 번호

by 무적김두칠 2022. 1. 1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
n=int(input())
studentList=[input() for i in range(n)]
numberLen=len(studentList[0])
# print(studentList)
# print(numberLen)
for i in range(1,numberLen+1):
    compareList=[]
    for j in range(n):
        if studentList[j][numberLen-i:numberLen] in compareList: break
        else:
            compareList.append(studentList[j][numberLen-i:numberLen])
    #print(compareList)
    if len(compareList)==n:
        print(i)
        break
 
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 23827 수열 (Easy)  (0) 2022.01.04
백준 12788 제 2회 IUPC는 잘 개최될 수 있을까?  (0) 2022.01.01
백준 13171 A  (0) 2021.12.30
백준 17952 과제는 끝나지 않아!  (0) 2021.12.30
백준 11899 괄호 끼워넣기  (0) 2021.12.29

댓글