EPAM Systems interview question

I was given a task to solve using the Stream API.

Interview Answer

Anonymous

27 Sept 2023

I solved it correctly. During the solution, I explained the reasoning to the interviewer and asked him clarifying questions.