3 test cases are failing
Send me hackerblocks link where you are submitting this problem. I’ll let you know.
Try for this input
15
12 10 17 22 20 85 74 38 23 64 46 51 65 99 87
10 12 17 20 22 23 38 46 51 64 65 74 85 87 99
10
10 2
17 3
22 4
20 2
23 5
46 4
51 2
65 3
99 1
85 2
Expected output is:
17
74 99
23 64
17 85
17 20 87
85
64
Take reference from this
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.