Raisin interview question

Explain the home task solution.