Jet Interview Question

How to replace for loops using functional style?