PEAK6 Interview Question

Question that was around a leetcode medium difficulty