Source Code:[ Ссылка ]
Solution:
- Sort the array
- Take two loop & iterate each element
- Now for each element, you check if there exists a pair whose sum is equal to targetSum - current value
- When you find out value, you add in final list, else you increase start or decrease end depending on value addition
Time Complexity: O(n * n * n)
Space Complexity: O(1)
Do Watch video for more info
CHECK OUT CODING SIMPLIFIED
[ Ссылка ]
★☆★ VIEW THE BLOG POST: ★☆★
[ Ссылка ]
I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 400+ videos.
★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★
[ Ссылка ]
★☆★ Send us mail at: ★☆★
Email: thecodingsimplified@gmail.com
![](https://i.ytimg.com/vi/YkkReNbJdMg/maxresdefault.jpg)