Taller Technologies Interview Question

How to solve this pseudo code I posted in chat: