Intuit interview question

Just basic algorithm questions