NTT DATA Interview Question

To write code for a simple math problem