Minimal Cyclic Shift

  • + 1 comment

    Aren't you trailing a red herring with that upper bound on k?

    • + 1 comment

      Don't worry. If k>=n-1, any two sequences of length n would be similar. So the real upper limit is that of n, which is 10^5.

      • + 0 comments

        That's exactly what I meant by the upper bound of 10^9 on k being a red herring.