Author: shakil ahmed
Given a sentence “S” and a word “s”. Need to find how many times word “s” occurs as a substring of “S”.
This is straight forward KMP problem . One tricky thing is that one has to remove spaces from first string first . One can learn KMP from this video.
Author’s solution can be found here.