Given 2 numbers N and K followed by elements of N .Print 'yes' if K exists else print 'no'.
Given 2 numbers N and K followed by elements of N .Print 'yes' if K exists else print 'no'.
Sample Testcase :
INPUT
4 2
1 2 3 3
OUTPUT
Sample Testcase :
INPUT
4 2
1 2 3 3
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 a = (userInput[0]);
var inp = a.split(' ');
var k = inp[1]
var b = (userInput[1]);
var arr = b.split(" ")
var out = arr.includes((k))
if(out)
console.log('yes')
else
console.log('no')
});
const inp = readline.createInterface({
input: process.stdin
});
const userInput = [];
inp.on("line", (data) => {
userInput.push(data);
});
inp.on("close", () =>
{var a = (userInput[0]);
var inp = a.split(' ');
var k = inp[1]
var b = (userInput[1]);
var arr = b.split(" ")
var out = arr.includes((k))
if(out)
console.log('yes')
else
console.log('no')
});
Comments
Post a Comment