Jabil Interview Question

How to solve your program