MathWorks interview question

Tested on python iterators, map functions.