Intuit interview question

Fix the code using closure principle.