We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53ce7c7 commit 511c793Copy full SHA for 511c793
contains-duplicate/minji0214.ts
@@ -0,0 +1,10 @@
1
+function containsDuplicate(nums: number[]): boolean {
2
+ let answer = false
3
+ for(let i = 0; i< nums.length; i ++ ){
4
+ if(nums.findIndex((value)=> value === nums[i]) !== i){
5
+ answer = true
6
+ return false
7
+ }
8
9
+ return answer
10
+};
0 commit comments