Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[03주차 이윤호] 호텔 방 번호 #16

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions 02주차/이윤호/solution02.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
def repeat(num):
str_num = str(num)
list_num = list(str_num) #를 리스트로 변환

repeat_num = 0

for i in range(len(list_num)): # 리스트 안 중복 요소 검사
for j in range(i + 1, len(list_num)):
if list_num[i] == list_num[j] :
repeat_num = 1
break
return repeat_num


def no_repeat_maker(N, M): # 숫자가 중복된 번호 개수 뽑아내기
c = 0
for num in range(N, M + 1):
repeat(num)
if repeat(num) == 1 :
c = c + 1
return c


while True:
try:
N, M = map(int, input().split())
result = no_repeat_maker(N, M)
print(M - N + 1 - result) #두 번호 사이의 번호의 갯수 - 중복되는 번호의 갯수
except EOFError:
break
Loading