DXC Technology interview question

Solve the code as per the given inputs and outputs.