Fidelity International interview question

Solve some programs using streams API