Given a string S, print 'yes' if it has a vowel in it else print 'no'. Sample Testcase : INPUT codekata OUTPUT yes
Given a string S, print 'yes' if it has a vowel in it else print 'no'.
Sample Testcase :
INPUT
codekata
OUTPUT
yes
const readline = require('readline');
const inp = readline.createInterface({
input: process.stdin
});
const userInput = [];
inp.on("line", (data) => {
userInput.push(data);
});
inp.on("close", () => {
var data = userInput[0].split(" ");
var a = String(data[0]);
var b=a.split("")
var v;
var count=false
for(v of b)
{
if(v == "a" || v == "e" || v == "i" || v == "o" || v == "u" ||
v == "A" || v == "E" || v == "I" || v == "O" || v == "U")
count=true
}
if(count)
console.log('yes')
else
console.log('no')
});
Sample Testcase :
INPUT
codekata
OUTPUT
yes
const readline = require('readline');
const inp = readline.createInterface({
input: process.stdin
});
const userInput = [];
inp.on("line", (data) => {
userInput.push(data);
});
inp.on("close", () => {
var data = userInput[0].split(" ");
var a = String(data[0]);
var b=a.split("")
var v;
var count=false
for(v of b)
{
if(v == "a" || v == "e" || v == "i" || v == "o" || v == "u" ||
v == "A" || v == "E" || v == "I" || v == "O" || v == "U")
count=true
}
if(count)
console.log('yes')
else
console.log('no')
});
Comments
Post a Comment