Visa Inc. Interview Question

The solve an medium level DSA question