You are viewing a single comment's thread. Return to all comments →
I was using the nested loop algo, was getting timed out.
Then i used this (JAVA)
i am a beginner, can anyone tell me is this a bad way to solve a problem, if yes why?
The Actual vision of the problem is to solve it by without actually making any rotations.because rotation takes more time and space.thats why you may get timeout errors if you try to solve it by rotations .we gotta have to solve it by doing calculations .Example: write a simple logic to determine what will be the output after k rotations.if K is equal to N then no rotations needed coz the array will be the same as original after rotations.