Groupon interview question

Leetcode easy array 3 Simple SQL query