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.
The writeup specified that the output was to be printed the array reflecting the rotation. Nothing about having to actually create a rotated array and dump it to the console. And considering the submitter never supplied a stub to the actual rotation routine specifying the return as being an array, this is a legitmate answer. Likely not the one the OP intended.
If I were to give a coding test to someone I'd toss them something like this. Likely they'd code out a fancy in-place algorithm, in which I would warn them that they were over-engineering the solution for the specified output.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
The writeup specified that the output was to be printed the array reflecting the rotation. Nothing about having to actually create a rotated array and dump it to the console. And considering the submitter never supplied a stub to the actual rotation routine specifying the return as being an array, this is a legitmate answer. Likely not the one the OP intended.
If I were to give a coding test to someone I'd toss them something like this. Likely they'd code out a fancy in-place algorithm, in which I would warn them that they were over-engineering the solution for the specified output.