New Year Chaos

  • + 1 comment

    TestCase 2: I/P ==>1 2 5 3 7 8 6 4 O/P ==>7

    Acc to qn, a person can swap only with the person in front of him and max of 2 swaps are only allowed.

    Hence, person 4 has moved to 8th position which is impossible. So, above solution should be "TOO CHAOTIC" only. How answer "7" is arrived ?

    Is there anything worng in test case or is my logic wrong?