• + 1 comment

    I was using the nested loop algo, was getting timed out. Then i used this (JAVA) Collections.rotate(Arrays.asList(array_name), k);

    i am a beginner, can anyone tell me is this a bad way to solve a problem, if yes why?