Turo interview question

Two relatively simple algorithm questions