Skip to content

Commit 51847b2

Browse files
committed
newline add in file
1 parent cf08ece commit 51847b2

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

โ€Žcontains-duplicate/se6816.javaโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ public boolean containsDuplicate(int[] nums) {
1212

1313
return count != nums.length;
1414
}
15-
}
15+
}

โ€Žlongest-consecutive-sequence/se6816.javaโ€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/**
22
Problem 128 : Longest Consecutive Sequence
33
Summary :
4-
- for๋ฌธ์œผ๋กœ ์ˆœํšŒํ•˜๋ฉด์„œ, target์—์„œ ๋บ€ ๊ฐ’์„ ์ €์žฅํ•œ๋‹ค.
5-
- ์ €์žฅ๋œ ๊ฐ’๊ณผ ์ผ์น˜ํ•˜๋Š” ์ธ๋ฑ์Šค๋ฅผ ๋งŒ๋‚˜๋ฉด ํ•ด๋‹น ๊ฐ’์„ ๋ฆฌํ„ดํ•œ๋‹ค.
6-
- ๊ธฐ๋ณธ For๋ฌธ์ด O(N^2)์ด๋ผ๋ฉด, ํ•ด๋‹น ๋ฐฉ๋ฒ•์˜ ๊ฒฝ์šฐ O(N)์ด ๊ฐ€๋Šฅํ•˜๋‹ค.
4+
- set์— ๋ชจ๋“  ์ˆซ์ž๋ฅผ ์ €์žฅํ•œ๋‹ค.
5+
- ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์ง„ ๋ฐฐ์—ด์„ ๋Œ๋ฉด์„œ ํ•ด๋‹น ์ˆซ์ž์˜ ์ด์ „ ์ˆซ์ž๊ฐ€ set์— ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธํ•œ๋‹ค.
6+
- ์—ฐ์†์ ์ธ ์ˆซ์ž ๋ฐฐ์—ด์˜ ๊ธธ์ด๋ฅผ ๊ตฌํ•˜๊ณ , ๋ณ„๋„์˜ set์— ๊ธฐ๋กํ•œ๋‹ค.
7+
- ํ•ด๋‹น ๋ฐฉ๋ฒ•์„ ์‚ฌ์šฉํ•˜๋ฉด ์‹œ๊ฐ„๋ณต์žก๋„๊ฐ€ O(N)์ด ๋œ๋‹ค.
78
89
*/
910
class Solution {

โ€Žtwo-sum/se6816.javaโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ public int[] twoSum(int[] nums, int target) {
2121
}
2222
return result;
2323
}
24-
}
24+
}

0 commit comments

Comments
ย (0)