First Orion Interview Question

Can you walk through your solution for this specific hacker rank problem?