题目:
提交:
let str = readline()
str = str.replace(/\W+/g, '-')
// console.log(str)
function getLastWordLength (str) {
const arr = str.split('-');
const lastIndex = arr.length - 1;
return arr[lastIndex].length || arr[lastIndex - 1].length ;
}
console.log(getLastWordLength(str))