Блог пользователя abcyyyy

Автор abcyyyy, история, 6 лет назад, По-английски

How to solve a question where the string is first circularly rotated by 1 letter, then by 2 letter and soon , at what time the modified string will be equal to original string? these strings are made up using 'a' and 'b' only.

for eg: aabaab is the string on first letter rotation it will become abaaba on second rotation it will become aabaab so answer is 2.

I tried to solve this question but could only do this only by brute force. https://pasteboard.co/Hz1WUBx.jpg

Any help will be appreciated.

Полный текст и комментарии »

  • Проголосовать: нравится
  • -18
  • Проголосовать: не нравится