Help in RIO3 problem

Help me in RIO3 Problem - CodeChef this problem please. I have written code in java . i am able to pass test successfully but during submission i get error.

i am new here btw,so any help is appreciated.

Try these test cases -

1)

10
1 1

2)

10 
3 2

3)

10
1 2

You’ll notice that the same numbers are being printed repeatedly, also, at times, the increasing order that the numbers should be in, is not being follwed.

You can refer to my solution in Java to undersatnd how to solve it - CodeChef: Practical coding for everyone

On a side note, this problem has weak test cases, and so O(N^2) solutions are passing, which shouldn’t ideally.

Hope this helped :slight_smile:

2 Likes