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.
I think the problem statement needs to be cleaned-up.
Here's my interpretation :
A right-rotation is when all chars of the suffix block are bumped one place to the right except for the final char which jumps left to the beginning of the block.
A left rotation is when all chars of the suffix block are bumped one place to the left except for the first char which jumps right to the end of the block ( and end of the string ).
So in the first example problem they are performing right-rotations.
But in Explanation 0 they instead perform left-rotations without explicitly stating such.
Maybe this is intentional. I just think the problem is difficult enough without explicitly spelling-out what moves are being performed in the examples.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Suffix Rotation
You are viewing a single comment's thread. Return to all comments →
I think the problem statement needs to be cleaned-up.
Here's my interpretation :
A right-rotation is when all chars of the suffix block are bumped one place to the right except for the final char which jumps left to the beginning of the block.
A left rotation is when all chars of the suffix block are bumped one place to the left except for the first char which jumps right to the end of the block ( and end of the string ).
So in the first example problem they are performing right-rotations.
But in Explanation 0 they instead perform left-rotations without explicitly stating such.
Maybe this is intentional. I just think the problem is difficult enough without explicitly spelling-out what moves are being performed in the examples.