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.
As other ppl suggested, just focus on math, no extra space complexity needed, no loop needed, simplest solution is linear. Write yourself some example, what if K is greater than N, what if K is less than N, etc
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Circular Array Rotation
You are viewing a single comment's thread. Return to all comments →
As other ppl suggested, just focus on math, no extra space complexity needed, no loop needed, simplest solution is linear. Write yourself some example, what if K is greater than N, what if K is less than N, etc