Given a day, print 'yes' if it is a holiday otherwise print'no'.Assume that weekend days are holidays
Given a day, print 'yes' if it is a holiday otherwise print'no'.Assume that weekend days are holidays
Sample Testcase :
INPUT
saturday
OUTPUT
yes
INPUT
monday
OUTPUT
no
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])
if(a=='saturday'||a=='sunday')
console.log('yes')
else
console.log('no')
});
Sample Testcase :
INPUT
saturday
OUTPUT
yes
INPUT
monday
OUTPUT
no
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])
if(a=='saturday'||a=='sunday')
console.log('yes')
else
console.log('no')
});
Comments
Post a Comment