Pfizer interview question

Leetcode medium to leetcode medium hard