ION Group Interview Question

Balls puzzle Query to get duplicate email