Arrays-Target Sum Triplets

https://ide.codingblocks.com/#/s/24409
https://hack.codingblocks.com/contests/c/457/215

  1. Your solution is O(N^3) which will give TLE as N is 1000. So think of sorting the array and using two pointer technique to solve this one.

  2. I think you have to print triplets in lexographically sorted order, so if you sort the array before running your code, it wont prodce wrong answer