Two Pointer Technique Problems Leetcode Sql Queries