Two Pointers Questions Leetcode Sql Server