Two Pointers: common mistakes
Two pointers work only because the array is sorted and each move has a reason. Here are three slips: forgetting to sort, moving the wrong pointer when the sum is too small, and counting one triplet where right - left of them work.
Pick a mistake and press play: Wrong runs the code with the mistake until it breaks, and the code marks the wrong line in red. Fixed runs the corrected code on the same input, with the corrected line in green.