@lakshitf Try
1
2 2
@petch
Sorry I put the wrong code here, my submission is : https://www.codechef.com/viewsolution/22482748
Please help me to find the wrong test case.
1
2 5
Your output is
4
1 1 2 2 1
2 3 3 4 1
But you can use actually use at most 3 numbers:
3
1 2 3 1 2
1 2 3 1 2
Please can someone suggest me what’s wrong in my code? I am not getting where am i going wrong.
https://www.codechef.com/viewsolution/22517943
this is my sample input and output:
input:
8
1 1
1 2
2 1
2 2
2 3
3 2
3 3
3 4
output:
1
1
1
1 1
1
1
1
2
1 1
2 2
3
1 2 3
1 2 3
3
1 1
2 2
3 3
4
1 1 2
3 3 4
2 2 1
4
1 1 2 2
3 3 4 4
2 2 1 1