Alt_of_Charon's blog

By Alt_of_Charon, history, 7 weeks ago, In English

This submission was wrong but still got AC

what if in the latter part we have a vector where a total of two pairs are in there incorrect position and one pair is set up in that vector such that it will pass the loop of checking whether after swapping we will get the same element which we store in the auxiliary sorted copy of the initial vector. That should fail the test cases right? But it didn't.

 
 
 
 
  • Vote: I like it
  • +16
  • Vote: I do not like it

»
7 weeks ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

yes, you're right

here's test case

1

2 4

2 1 3 3

1 1 3 2