Function to count permutations of string such that no two vowels are adjacent
function countWays ( str ) { let freq = new Array ( 26 ) ; for ( let i = 0 ; i < 26 ; i ++ ) { freq [ i ] = 0 ; } let nvowels = 0 , nconsonants = 0 ; let vplaces , cways , vways ;