SquareShift interview question

RotateArray Remove duplicates from the sequence