Visa Inc. interview question

The medium question was a DP question