Deloitte Interview Question

Asked on java streams which was tough one