sol: https://ide.codingblocks.com/s/382771
prob:https://hack.codingblocks.com/app/contests/1975/413/problem
sol: https://ide.codingblocks.com/s/382771
prob:https://hack.codingblocks.com/app/contests/1975/413/problem
Hey @raghav007
You have to first sort the array and then use two pointer approach to get the desired results.
This is how its implemented in the backend.
otherwise ur approach is absolutely correct though its O(n^2)
oh alright thanks I will try that way too