ServiceTitan interview question

Leet Code questions 2 easy problems