Google Interview Question

sql, python, to find optimal solutions