백준 1527 파이썬
·
Algorithm/Graph
(1) 처음 내 코드 -> 시간초과a,b = map(int,input().split())cnt = 0s1="4"s2="7"for i in range(a,b+1): s = str(i) bool=True for j in s: if j==s1 or j==s2: continue else: bool=False break if bool==True: cnt+=1print(cnt)입력이 1보다 크고, 1,000,000,000보다 작거나 같은 자연수로, 코드 제출하기 버튼을 누르면서도 뭔가 시간초과가 날거 같았다.  (2) 문제 해결 후 내 코드 -> product 사용from itertools impo..
_은선_
'프로그래머스' 태그의 글 목록