Skip to content

Commit

Permalink
28
Browse files Browse the repository at this point in the history
  • Loading branch information
park-jiyeong committed Jul 16, 2024
1 parent 3272b3f commit 1f02541
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions JYPARK/21to30/28.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def solution(N, A, B):
answer = 0
while True:
if A == B:
break
if A % 2 == 0:
A = A // 2
else:
A = A // 2 +1
if B % 2 == 0:
B = B // 2
else:
B = B // 2 + 1
answer += 1
return answer

N = 8
A = 4
B = 7
print(solution(N, A, B))

0 comments on commit 1f02541

Please sign in to comment.