You are given a ‘true’ string. String is called true if weight of string is multiple of 8. Your task is to tell whether a string can be declared True or Not. Weight of string is the sum of ASCII value of Vowel character(s) present in the string.
You are given a ‘true’ string. String is called true if weight of
string is multiple of 8. Your task is to tell whether a string can be
declared True or Not. Weight of string is the sum of ASCII value of
Vowel character(s) present in the string.
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 sum=0;
for (i=0;i<a.length;i++)
{sum=sum+a.charCodeAt(i)}
if(sum%8==0)
console.log(1)
else
console.log(0)
});
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 sum=0;
for (i=0;i<a.length;i++)
{sum=sum+a.charCodeAt(i)}
if(sum%8==0)
console.log(1)
else
console.log(0)
});
Comments
Post a Comment