Getting run error in Pair of roses

ques: https://hack.codingblocks.com/contests/c/547/696
code: https://ide.codingblocks.com/s/55748

why are you using so much complex code.
just sort the values and use 2 pointer approach

but still y run error is coming?

We dont include debug your code as you can use any approach .
We are here to you tell u the correct approach of solving the doubts.
If you can write the code using sort the values and then 2 pointer appraoch , then i will debug your code.

nvm I found the error

1 Like