题解 | #查找重复元素#

查找重复元素

http://www.nowcoder.com/practice/871a468deecf453589ea261835d6b78b

{"css":"","js":"\nfunction duplicates(arr) {\n    return arr.filter(function(item,index,array){\n            return array.indexOf(item) !== array.lastIndexOf(item) && array.indexOf(item,0) === index;\n    })\n}","html":"","libs":[]}
全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

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