Gives WA for all test case

link to code : https://ide.codingblocks.com/s/239236
I’ve checked for my code, plenty of times, still it gives WA.
My solution works in O(nlogn)

@O17LPOLA020011
problem is when you taking one element and search for m-element, then there may be possibility that the m-arr[i] is same as arr[i] in that case it will return true but it shouldn’t have.

For eg:- roses are 40 50 30 and you want sum = 80.
In that case your code will return 40 and 40 but there is only one rose of value 40.
So you also need to check the the required element is that itself or not.

Also one more advice, in diff variable take abs(m-2*arr[i]), you have not took abs().

That solved the problem, thanks !