Skip to content

Commit ba0554a

Browse files
authored
Merge branch 'DaleStudy:main' into main
2 parents 16f9fe5 + 4eda421 commit ba0554a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+2049
-1
lines changed

.github/workflows/integration.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 🔄 Integration
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
linelint:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: fernandrone/[email protected]

.linelint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# 'true' will fix files
2+
autofix: false
3+
4+
# list of paths to ignore, uses gitignore syntaxes (executes before any rule)
5+
ignore:
6+
- "*.md"
7+
8+
rules:
9+
# checks if file ends in a newline character
10+
end-of-file:
11+
# set to true to enable this rule
12+
enable: true
13+
14+
# set to true to disable autofix (if enabled globally)
15+
disable-autofix: false
16+
17+
# if true also checks if file ends in a single newline character
18+
single-new-line: false

contains-duplicate/0-chan.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* time complexity : O(n)
3+
* space complexity : O(n)
4+
*/
5+
function containsDuplicate(nums: number[]): boolean {
6+
const hasDuplicate = new Set(nums).size !== nums.length;
7+
return hasDuplicate;
8+
};

contains-duplicate/GUMUNYEONG.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {boolean}
4+
*/
5+
var containsDuplicate = function (nums) {
6+
const setObj = new Set(nums);
7+
8+
const diff = !(nums.length === setObj.size);
9+
10+
return diff;
11+
};
12+
13+
// TC: O(n)
14+
// SC: O(n)

contains-duplicate/HC-kang.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
217. Contains Duplicate
3+
4+
Example 1:
5+
Input: nums = [1,2,3,1]
6+
Output: true
7+
8+
Example 2:
9+
Input: nums = [1,2,3,4]
10+
Output: false
11+
12+
Example 3:
13+
Input: nums = [1,1,1,3,3,4,3,2,4,2]
14+
Output: true
15+
*/
16+
17+
// Time complexity: O(n)
18+
// Space complexity: O(n)
19+
function containsDuplicate(nums: number[]): boolean {
20+
return nums.length !== new Set(nums).size;
21+
}

contains-duplicate/Raft.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def containsDuplicate(self, nums: List[int]) -> bool:
3+
appeared = defaultdict(int)
4+
for n in nums:
5+
if appeared[n] > 0:
6+
return True
7+
appeared[n] += 1
8+
9+
return False
10+
# T: O(n)
11+
# S: O(n)
12+

contains-duplicate/dm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from typing import List
2+
3+
4+
class Solution:
5+
def containsDuplicate(self, nums: List[int]) -> bool:
6+
return len(nums) != len(set(nums))

contains-duplicate/f-exuan21.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// time : O(n)
2+
// space : O(n)
3+
4+
class Solution {
5+
public boolean containsDuplicate(int[] nums) {
6+
Set<Integer> set = new HashSet<>();
7+
for(int i : nums) {
8+
if(set.contains(i)) {
9+
return true;
10+
}
11+
set.add(i);
12+
}
13+
return false;
14+
}
15+
}
16+

contains-duplicate/hajunyoo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Solution:
2+
# Time complexity: O(n)
3+
def containsDuplicate(self, nums: List[int]) -> bool:
4+
string_len = len(nums)
5+
set_len = len(set(nums))
6+
7+
return string_len != set_len

contains-duplicate/hwanminini.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// 시간복잡도: O(n)
2+
// 공간복잡도: O(n)
3+
4+
/**
5+
* @param {number[]} nums
6+
* @return {boolean}
7+
*/
8+
var containsDuplicate = function(nums) {
9+
return nums.length !== new Set(nums).size
10+
};

0 commit comments

Comments
 (0)