PARTech Interview Question

Leetcode questions. Not too hard