반응형

-풀이

n, l = map(int, input().split())
count = 1
label = []
while len(label) < n:
  if str(l) not in str(count):
    label.append(count)
    count += 1
  elif str(l) in str(count):
    count += 1
print(count-1)

-풀이 설명

[20분 sol] while문에 1~n까지 count문자열에 l문자열이 없을 때만 label리스트에 값을 append해주어 n만큼 label길이가 같아지면 while문을 종료하고 count-1을 출력한다. -1을 하는 이유는 if문에 label에 값을 추가하고 다음 값을 계산하기위해 count에 1을 더해줬기 때문이다.

+ Recent posts