Ad
  • Custom User Avatar

    You don't need to convert numbers. You can also do it with integer modulo and division (although that's a bit more tedious to write). And you don't need to keep any lists, sorting, etc. Just keep track of the largest number as you do each rotation step.