Development/코딩테스트

[백준] 1264 Node.js

Yeony99 2022. 9. 20. 21:42
728x90
const fs = require('fs');
const input = fs.readFileSync("/dev/stdin").toString().trim().split("\n");

function getVowelCount(str) {
    const matches = str.match(/[aeiou]/gi);
    return matches ? matches.length : 0;
}

for(let i = 0; i < input.length-1; i++) {
    console.log(getVowelCount(input[i]))
}
728x90