You are viewing a single comment's thread. Return to all comments →
How to think like this ? Once the code is there I know its easy to understand.I want to know how did you know to use modulous and how did you come up thinking that logic ?
thanks in advance.
Have you ever heard about Data Structure ? because if you do , you would probably heard about circular array.
I was able to solve the question because I'm knew about circular arrays , we use % + size of array to create a cirural array , then all you need to do is to complete the puzzle to solve the problem.
check this video,
This is super helpful, thanks so much for sharing!