Edmunds GovTech interview question

If you do LeetCode regularly, you will find this easy