SIMON Markets interview question

4 hacker rank 3 SQL 1 python