Skip to content

Commit acacff5

Browse files
committed
chore: @Constraints 내용 추가
1 parent 6f7243a commit acacff5

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

best-time-to-buy-and-sell-stock/lledellebell.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
* @problem
44
* 주어진 주식 가격 배열에서 한 번의 매수와 한 번의 매도를 통해 얻을 수 있는 최대 이익을 계산합니다.
55
* 매수는 매도보다 반드시 먼저 이루어져야 합니다.
6+
*
7+
* @constraints
8+
* - 1 <= prices.length <= 105
9+
* - 0 <= prices[i] <= 104
610
*
711
* @param {number[]} prices - 각 날짜별 주식 가격을 나타내는 배열
812
* @returns {number} 최대 이익 (이익을 낼 수 없는 경우 0 반환)
@@ -11,7 +15,7 @@
1115
* maxProfit([7, 1, 5, 3, 6, 4]); // 5 (2일차에 매수하고 5일차에 매도)
1216
* maxProfit([7, 6, 4, 3, 1]); // 0 (이익을 낼 수 없음)
1317
*
14-
* @description
18+
* @complexity
1519
* - 시간 복잡도: O(n)
1620
* 배열을 한 번 순회하며 각 요소에 대해 상수 시간 연산만 수행합니다.
1721
* - 공간 복잡도: O(1)

encode-and-decode-strings/lledellebell.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* const decoded = decode(encoded);
1111
* console.log(decoded); // ["hello", "world"]
1212
*
13-
* @description
13+
* @complexity
1414
* - 시간 복잡도:
1515
* ㄴ encode: O(n) (n은 문자열 배열의 총 길이)
1616
* ㄴ decode: O(n) (n은 인코딩된 문자열의 길이)

group-anagrams/lledellebell.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
* (참고)
77
* 애너그램(Anagram)이란 단어를 구성하는 문자의 순서를 바꿔서 다른 단어를 만드는 것을 의미합니다.
88
* 예를 들어, "eat", "tea", "ate"는 모두 같은 문자로 구성되어 있으므로 애너그램입니다.
9+
*
10+
* @constraints
11+
* - 1 <= strs.length <= 104
12+
* - 0 <= strs[i].length <= 100
13+
* - strs[i]는 소문자 알파벳으로만 구성됩니다.
914
*
1015
* @param {string[]} strs - 입력 문자열 배열
1116
* @returns {string[][]} 애너그램 그룹으로 묶인 2차원 문자열 배열

implement-trie-prefix-tree/lledellebell.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
* Trie를 구현합니다.
44
* - 메모리 사용량을 최적화하면서 정확한 검색 결과를 보장해야 합니다.
55
*
6+
* @constraints
7+
* - word와 prefix의 길이는 최소 1, 최대 2000입니다.
8+
* - word와 prefix는 소문자 영어 알파벳(a-z)만으로 구성됩니다.
9+
* - insert, search, startsWith 함수 호출은 총 30,000번을 넘지 않습니다.
10+
*
611
* @example
712
* const trie = new Trie();
813
* trie.insert("apple"); // undefined
@@ -12,7 +17,7 @@
1217
* trie.insert("app"); // undefined
1318
* trie.search("app"); // true
1419
*
15-
* @description
20+
* @complexity
1621
* - 시간복잡도:
1722
* ㄴ insert: O(m) (m은 단어 길이)
1823
* ㄴ search: O(m) (m은 단어 길이)

word-break/lledellebell.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* ㄴ Output: false
2828
* ㄴ Explanation: "catsandog"는 wordDict의 단어들로 나눌 수 없습니다.
2929
*
30-
* @description
30+
* @complexity
3131
* - 시간 복잡도: O(n^2)
3232
* ㄴ 외부 반복문: 문자열 s의 길이 n에 대해 1부터 n까지 반복 (O(n))
3333
* ㄴ 내부 반복문: 각 i에 대해 최대 i번 반복 (O(n))

0 commit comments

Comments
 (0)