Skip to content

Commit 22e4e05

Browse files
committed
minor formatting for Maximum product subarray
1 parent ac9f691 commit 22e4e05

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

β€Žmaximum-product-subarray/KwonNayeon.pyβ€Ž

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
- -10 <= nums[i] <= 10
55
- The product of any subarray of nums is guaranteed to fit in a 32-bit integer.
66
7-
Time Complexity:
8-
- O(n): 배열을 ν•œ 번만 μˆœνšŒν•˜λ©΄μ„œ 각 μœ„μΉ˜μ—μ„œ μƒμˆ˜ μ‹œκ°„ μ—°μ‚°λ§Œ μˆ˜ν–‰
7+
Time Complexity: O(n)
8+
- 배열을 ν•œ 번만 μˆœνšŒν•˜λ©΄μ„œ 각 μœ„μΉ˜μ—μ„œ μƒμˆ˜ μ‹œκ°„ μ—°μ‚°λ§Œ μˆ˜ν–‰
99
10-
Space Complexity:
11-
- O(1): κ³ μ •λœ μΆ”κ°€ λ³€μˆ˜λ§Œ μ‚¬μš© (curr_max, curr_min, ...)
10+
Space Complexity: O(1)
11+
- κ³ μ •λœ μΆ”κ°€ λ³€μˆ˜λ§Œ μ‚¬μš© (curr_max, curr_min, ...)
1212
1313
풀이방법:
1414
1. DP둜 각 μœ„μΉ˜μ—μ„œ κ°€λŠ₯ν•œ μ΅œλŒ€κ³±κ³Ό μ΅œμ†Œκ³±μ„ λ™μ‹œμ— 좔적함
@@ -34,4 +34,3 @@ def maxProduct(self, nums: List[int]) -> int:
3434

3535
return result
3636

37-

0 commit comments

Comments
Β (0)