Skip to content

Commit b1dac37

Browse files
add 350 solution[js]
1 parent 6e6368a commit b1dac37

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const intersect = function(nums1, nums2){
2+
let arr = [];
3+
while(nums2.length > 0){
4+
let tmp = nums2.pop();
5+
if(nums1.indexOf(tmp) > -1){
6+
let indexTmp = nums1.indexOf(tmp);
7+
nums1.splice(indexTmp,1);
8+
arr.push(tmp);
9+
}
10+
}
11+
return arr;
12+
}

0 commit comments

Comments
 (0)