본문 바로가기

알고리즘/해커랭크

Arrays: Left Rotation

문제

https://www.hackerrank.com/challenges/ctci-array-left-rotation/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=arrays

 

제출 코드

def rotLeft(a, d):
    return a[d:]+a[:d]

 

너무 쉬워서 생략

'알고리즘 > 해커랭크' 카테고리의 다른 글

Jumping on the Clouds  (0) 2020.03.20
New Year Chaos  (0) 2020.03.16
Cats and a Mouse  (0) 2020.03.16
Repeated String  (0) 2020.03.09
Counting Valleys  (0) 2020.03.09