title: finding a triplet having a given sum
body: <p>I have been struggling with this questions for sometime now. The question goes like this:-</p>
  
  <p>We have n^2 numbers. We need to find out if there exists a triplet a,b,c such that a+b+c = 0. For a more generic case, a+b+c = k. (k is given)</p>
  
  <p>There exists a solution with O(n^2log(n)) complexity. </p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>thanks</p>