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.
hi @1634810124_coe3b
you have not used the k variable and also you have wrote a[0]=a[last]; do not assign like this ..because you are using a[0] in the loop afterwards.
Tip-->Assign the values in a[0] using temporary variable.
since you are using 2 for loops and probably you need one while loop or nested for loop for this kind of approach ...so you may face timeout in some testcases.
good luck
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 →
hi @1634810124_coe3b you have not used the k variable and also you have wrote a[0]=a[last]; do not assign like this ..because you are using a[0] in the loop afterwards. Tip-->Assign the values in a[0] using temporary variable. since you are using 2 for loops and probably you need one while loop or nested for loop for this kind of approach ...so you may face timeout in some testcases. good luck