Typescript Count Unique Values Python Interview