Sherlock And The Valid String Hackerrank