Skip to content

Commit 9ee3ab3

Browse files
committed
chore: lint
1 parent 3c26ea7 commit 9ee3ab3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

โ€Žcoin-change/whewchews.tsโ€Ž

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ function coinChange(coins: number[], amount: number): number {
88
* coins๋ฅผ ์ˆœํšŒํ•˜๋ฉด์„œ ๋ˆ„์ ์•ก์— ๋™์ „์„ ๋”ํ•œ ๊ฐ’์ด amount๋ณด๋‹ค ์ž‘์œผ๋ฉด queue์— ๋„ฃ๋Š”๋‹ค.
99
* queue๊ฐ€ ๋นŒ๋•Œ๊นŒ์ง€ ๋ฐ˜๋ณต
1010
* ํ๊ฐ€ ๋น„์–ด์žˆ๊ณ  amount๋ฅผ ๋งŒ๋“ค์ˆ˜ ์—†์œผ๋ฉด -1์„ return
11-
*/
12-
const queue = [[0, 0]]; // [number of coins, accumulated amount]
11+
*/ const queue = [[0, 0]]; // [number of coins, accumulated amount]
1312
const visited = new Set();
1413

1514
while (queue.length > 0) {
@@ -28,6 +27,6 @@ function coinChange(coins: number[], amount: number): number {
2827
}
2928
}
3029
return -1;
31-
// TC: ๊ฐ ๊ธˆ์•ก(amount)๋งˆ๋‹ค ๋™์ „(coins)์„ ์ˆœํšŒํ•˜๋ฏ€๋กœ O(N*M) N: amount, M: coins.length
32-
// SC: O(N) N: amount
3330
}
31+
// TC: ๊ฐ ๊ธˆ์•ก(amount)๋งˆ๋‹ค ๋™์ „(coins)์„ ์ˆœํšŒํ•˜๋ฏ€๋กœ O(N*M) N: amount, M: coins.length
32+
// SC: O(N) N: amount

0 commit comments

Comments
ย (0)