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` {
2929
3030 /* *
3131 * 2. 입력받은 정수 배열을 정렬하여 순회하면서 원소를 합산하여 0과 비교한 결과를 기준으로 투 포인터의 값을 조작한다.
32- * TC: O(n * log(n) + n ^2), SC: O(n)
32+ * TC: O(n^2), SC: O(n)
3333 */
3434 private fun usingTwoPointer (nums : IntArray ): List <List <Int >> {
3535 val sortedNumbers = nums.sorted()
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ class `word-break` {
1111
1212 /* *
1313 * 1. DFS 사용 (시간초과)
14- * TC: O(s^w * wordDict 단어의 길이), SC: O(s)
14+ * TC: O(w^s * wordDict 단어의 길이), SC: O(s)
1515 */
1616 private fun usingDFS (s : String , wordDict : List <String >): Boolean {
1717
@@ -58,7 +58,7 @@ class `word-break` {
5858
5959 /* *
6060 * 3. 문자열의 끝부터 0까지 순회하면서 순회하는 범위의 문자열을 만들 수 있다면 해당 인덱스를 true로 변환하여 이전에 사용한 연산의 결과를 재활용한다.
61- * TC: O(s * w * wordDict 단어의 길이) TC : O(s)
61+ * TC: O(s * w * wordDict 단어의 길이) SC : O(s)
6262 */
6363 private fun usingDP (s : String , wordDict : List <String >): Boolean {
6464 val dp = BooleanArray (s.length + 1 ).apply {
You can’t perform that action at this time.
0 commit comments