Let "A" be a string. Remove all the whitespaces and find it's length.
Input Description:
A string is provide as an input
Output Description:
Remove all the whitespaces and then print the length of the remaining string.
Sample Input :
Lorem Ipsum
Sample Output :
10
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 ='';
for(i=0;i<data.length;i++)
a=a+data[i];
console.log(a.length)
});
Comments
Post a Comment