DXC Technology Interview Question

Solve the code as per the given inputs and outputs.