LeapAP interview question

Explain the rationale behind these choices made when solving the test