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.
Suffix Rotation
Suffix Rotation
Sort by
recency
|
7 Discussions
|
Please Login in order to post a comment
Here's a sol:
Here is my solution in java, Python, C, C++, Csharp HackerRank Suffix Rotation Problem Solution
Here is Suffix Rotation problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-suffix-rotation-problem-solution.html
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.
guys, I am stuck, I've searched the internet, read a bit about suffix arrays, Lyndon words and factorization and some other stuff, but I can not figure out how this all applicable here.
I would greatly appreciate some hints.
Many thanks