You are viewing a single comment's thread. Return to all comments →
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?
Seems like cookies are disabled on this browser, please enable them to open this website
New Year Chaos
You are viewing a single comment's thread. Return to all comments →
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?