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.
2 parents eae0c5a + 1fbf055 commit b0893aaCopy full SHA for b0893aa
contains-duplicate/Lustellz.ts
@@ -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
+};
two-sum/Lustellz.ts
@@ -0,0 +1,6 @@
+function twoSum(nums: number[], target: number){
+ for(let i = 0; i < nums.length; i++){
+ for(let j = i+1; nums.length-j;j++)
+ if(nums[j] === target - nums[i]) return [i, j]
0 commit comments