I don’t understand what the error is. Compilation is successful, but the output is not being printed. Please check.
Pair of roses (STL)
The vector v should be declared inside the while loop.
And you are not updating the values of i and j when currentSum = key. Due to this, it becomes an infinite loop and results in a TLE error.
1 Like
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.