Levelset Interview Question

I was given a simple problem solving question and he asked me to share screen and write code to solve it on the ide