Sky Mavis interview question

Q: Solve a average leet code question