Count Valid Substrings - IBM OA Question | OAHelper