PayPay Interview Question

Solve an assignment given some data