Sherlock and Valid String

Problem Name:
Sherlock and Valid String
Site:HackerRank
Links:
Tags:
Problem setters:
Login to view your/friends' submissions
Login to suggest tags