Aeronix interview question

Whiteboard coding with pseudo code