File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class `3sum` {
29
29
30
30
/* *
31
31
* 2. 입력받은 정수 배열을 정렬하여 순회하면서 원소를 합산하여 0과 비교한 결과를 기준으로 투 포인터의 값을 조작한다.
32
- * TC: O(n * log(n) + n ^2), SC: O(n)
32
+ * TC: O(n^2), SC: O(n)
33
33
*/
34
34
private fun usingTwoPointer (nums : IntArray ): List <List <Int >> {
35
35
val sortedNumbers = nums.sorted()
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class `word-break` {
11
11
12
12
/* *
13
13
* 1. DFS 사용 (시간초과)
14
- * TC: O(s^w * wordDict 단어의 길이), SC: O(s)
14
+ * TC: O(w^s * wordDict 단어의 길이), SC: O(s)
15
15
*/
16
16
private fun usingDFS (s : String , wordDict : List <String >): Boolean {
17
17
@@ -58,7 +58,7 @@ class `word-break` {
58
58
59
59
/* *
60
60
* 3. 문자열의 끝부터 0까지 순회하면서 순회하는 범위의 문자열을 만들 수 있다면 해당 인덱스를 true로 변환하여 이전에 사용한 연산의 결과를 재활용한다.
61
- * TC: O(s * w * wordDict 단어의 길이) TC : O(s)
61
+ * TC: O(s * w * wordDict 단어의 길이) SC : O(s)
62
62
*/
63
63
private fun usingDP (s : String , wordDict : List <String >): Boolean {
64
64
val dp = BooleanArray (s.length + 1 ).apply {
You can’t perform that action at this time.
0 commit comments