Grid Dynamics Interview Question

Program : find word occurences in a given string.