Paymentology interview question

2D array coding exercise for take home test