Technical question on logical thinking were asked. You will have to answer with either pseudocode or write down the code (in your prefer language) on paper.
Anonymous
I wrote down my answer in code.
Check out your Company Bowl for anonymous work chats.