Typescript Array Find Duplicates Leetcode Rating