Sum Triplet Query

Sir/Maam,
Using said method in this video,
let us say we have an array
1, 2, 3, 4, 5, 6, 7, 7
here (1, 2, 7) should be the answer twice ??
if yes, so in this video at 2:00 we did l++ and r-- simultaneously .
After it reaches pointer l=2 and r=7(last 7);
we did l++ and r-- ;
so l=3 and r=7(second last 7).
So we will miss the second answer.
If you could pls specify a better way to resolve this problem.
Thank you.

This qs is relating to prev video i.e., Sum Triplet Hint.

yaa you are correct in two pointer approach we will not be able to generate all the ans…so you could just use a bruteforce technique(3 loops) or you could use a hashmap to optimize your logic…