Please correctt the code as i am not understanding how to correct the code ad is showing wrong message


please correct the code

hey @harryson there are couple of mistakes in your code

  1. since you were returning true right after finding the first triplet the code will only print one triple, no need to return anything make the function of void type
  2. you were taking sum input before array but in the question it is given after the array
  3. you weren’t sorting the array
    Here is link to your code after the above mentioned rectifications: https://ide.codingblocks.com/s/187563

@harryson If you don’t have any further queries please mark the doubt as resolved.