题解 | #字符个数统计#
字符个数统计
http://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50
let arr = readline().split(''); let count = 0; arr = Array.from(new Set(arr)); for( let i = 0; i <= 127; i++){ arr.forEach( str => { if(str.charCodeAt(0) < 0 || str.charCodeAt(0) > 127){ conose.log(str) } else if(str.charCodeAt(0) === i){ count ++; } }) }
console.log(count);