function isGoodString($string) { // Check repeating char with exactly one char in between $repeatingCharFound = repeatingCharFound($string); // Check repeating substrings of length 2 $repeatingStringFound = repeatingStringFound($string); return $repeatingCharFound && $repeatingStringFound; }
function isGoodString($string) { // Check vowels $vowelAmountAllowed = vowelAmountAllowed($string); // Check repeating char $repeatingCharFound = repeatingCharFound($string); // Check bad strings $containsNoBadStrings = containsNoBadStrings($string); return $vowelAmountAllowed && $repeatingCharFound && $containsNoBadStrings; }