Sam and sub-strings

Problem Name:
Sam and sub-strings
Site:HackerRank
Links:
Tags:
Problem setters: