Typescript Array Find Duplicates Leetcode Two Pointers Problems