Question:-https://practice.geeksforgeeks.org/problems/triplet-sum-in-array/0
Code:-
This code worked for hackerblocks but it gives wrong answer on gfg.
Question:-https://practice.geeksforgeeks.org/problems/triplet-sum-in-array/0
Code:-
This code worked for hackerblocks but it gives wrong answer on gfg.
hello @div_yanshu07 there must be some difference in constraints or any condition .
please give me some time i will see your code and let you know the mistake .
hey @div_yanshu07 they just want to check if the triplet exists or not .
so you dont actually have to count the total number of triplets rather you have to output 1 if the triplet exists doesnt matter how many triplets exists .
and if not triplet makes upto sum equal to k then you have to output 0 .
but even making this change in you code it is givinf TLE.
i have reframed your logic and now it is passing every test case .
Happy Learning !!