Drip (CA) interview question

Medium level DS algo problems