Visa Inc. Interview Question

2 Hackerrank questions - 1 easy and 1 mid-hard