题解 | #数组去重#

字符串字符统计

http://www.nowcoder.com/practice/777d0cd160de485cae0b1fd1dd973b44

{"css":"","js":"function count(str) {\n    let obj = {};\n    for (let i = 0;i<str.length;i++){\n        if(obj[str[i]]){\n            obj[str[i]] += 1;\n        }else{\n            obj[str[i]] = 1;\n        }\n    }\n    return obj\n}","html":"","libs":[]}
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务