Grid Dynamics interview question

Program : find word occurences in a given string.