Loading Translate Menu ..
Facebook Official Page Twitter Official Page Youtube ChannelOfficial Page

Discussion in 'run-around-can-you-close-the-loop' started by Asim - Apr 15th, 2023 4:13 am.
Asim
Asim
  • Start by identifying the number of digits in the input number. If the input number has n digits, then the number can only have digits between 1 and n.
  • Create a visited array of size n and initialize it with all zeros. This array will keep track of the digits that have already been visited.
  • Start at the first digit of the input number and mark it as visited.
  • Using the value of the current digit, determine the index of the next digit to visit by wrapping around to the beginning if necessary. For example, if the current digit is 4 and the input number is 1234, then the index of the next digit to visit would be (0 + 4) % 4 = 0.
  • If the next digit to visit has already been visited, then the number is not a valid run-around number. Otherwise, mark the next digit as visited and repeat step 4 until all digits have been visited exactly once.
  • If all digits have been visited exactly once and the current index is back to the first digit, then the number is a valid run-around number. Otherwise, it is not.
Post Reply
*
* Will be hidden from visitors
Your Avatar
* Limit 2Mb please
Your Comment:
 *
* - required fields

Important note: If you really love playing games. Please support game developers and buy atleast one small game package.

This Website is not affiliated with Run Around - Can you close the loop?. trademarks are the property of their respective owners. Game content and materials copyright Run Around - Can you close the loop?. all right reserved.