Jet interview question

How to replace for loops using functional style?