옹알이 (2)

Lv. 1

Solution

export function babblingII(babbling: string[]): number {
  const isPronounceable = (word: string) => {
    return !/(aya|ye|woo|ma)\1+/.test(word) && /^(aya|ye|woo|ma)+$/.test(word);
  };
  return babbling.filter(isPronounceable).length;
}