반응형
app.codility.com/programmers/lessons/3-time_complexity/frog_jmp/
나머지가 0보다 크면 1을 더해줌
def solution(X, Y, D):
# write your code in Python 3.6
q = (Y-X)//D
r = (Y-X)%D
return q if r == 0 else q+1
'개발 > 알고리즘' 카테고리의 다른 글
[codility] TapeEquilibrium (0) | 2021.02.16 |
---|---|
[codility]PermMissingElem (0) | 2021.02.16 |
[codility] OddOccurrencesInArray (0) | 2021.02.16 |
[codility] CyclicRotation (0) | 2021.02.16 |
[codility] BinaryGap (0) | 2021.02.16 |
댓글