Slaying Problems in C++ and Python | HashMap Problem





Ivan on Tech video

source

4 replies
  1. Oliver Bergqvist
    Oliver Bergqvist says:

    I just did this on the first one:

    def left_rotation(arr, d):
    return arr[d:] + arr[:d]

    n, d = list(map(int, input().split(' ')))
    arr = list(map(int, input().split(' ')))

    rotated_arr = left_rotation(arr, d)
    result = " ".join(map(str, rotated_arr))

    print(result)

    Reply

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *