Hone Health interview question

Misc leet code puzzle for SQL and Python.