📅  最后修改于: 2022-03-11 15:01:38.457000             🧑  作者: Mango
代码示例1
function firstDuplicate(a) {
let data = [];
for (dup of a) {
if (data[dup]) {
return dup
} else {
data[dup] = dup
}
}
return -1
}