J.P. Morgan interview question

A Leetcode easy problem on Sets