You should read the description again on how the rotations should be applied. Your algorithm rotates the whole number and that is not what is asked for here.
I am getting this error
For n = 38458215: 84582153 should equal 85821534
For n = 195881031: 958810311 should equal 988103115
for first 2 test cases
that next two test cases are passed my logic was to store each rotation in the rotations list to keep track of all the numbers generated.
Thank You
Fixed.
Good one, but def harder than 7 kyu.
Your code already gets IndexOutOfBoundsException. When I fix this it fails for two-digit numbers.
You should read the description again on how the rotations should be applied. Your algorithm rotates the whole number and that is not what is asked for here.
I am getting this error
For n = 38458215: 84582153 should equal 85821534
For n = 195881031: 958810311 should equal 988103115
for first 2 test cases
that next two test cases are passed my logic was to store each rotation in the rotations list to keep track of all the numbers generated.