We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Circular Array Rotation
Circular Array Rotation
Sort by
recency
|
3043 Discussions
|
Please Login in order to post a comment
Javascript solution:
Hi there! Here's my Java solution for the challenge.
https://github.com/eduardocintra/hacker-rank-solutions/blob/master/src/br/com/eduardocintra/easy/circulararrayrotation/CircularArrayRotation.java
My solution in Python
Solution in JS Using % operator to ignore all the non required array loops, and separate the array in 2, left side (beggining of array) defined by elements from -k index to the end. And right side from index 0 to -k position. Concatenate both arrays to provide final array and get the queries.
JavaScript