Sherlock and Valid String

Problem Name:
Sherlock and Valid String
Site:HackerRank
Links:
Tags:
Problem setters: