Hexaware Technologies Interview Question

They asked me to write a character occurance of the given string using stream API