Intuit interview question

Karat coding challenge