Sam and substrings | HackerRank

Sam and substrings