Skip to content

Commit e3a7af5

Browse files
authored
contains-duplicate solution
1 parent 89ea753 commit e3a7af5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

contains-duplicate/Lustellz.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function containsDuplicate(nums: number[]): boolean {
2+
let tmp: number[] = nums.toSorted()
3+
for(let i = 0 ; i < nums.length - 1 ; i++){
4+
if(tmp[i]===tmp[i+1]) return true
5+
}
6+
return false
7+
};

0 commit comments

Comments
 (0)