Hexaware Technologies interview question

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