Skip to content

Commit 5a45e96

Browse files
committed
Update paint-fence.cpp
1 parent f92ef4b commit 5a45e96

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

C++/paint-fence.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Time: O(n)
22
// Space: O(1)
3+
4+
// DP with rolling window.
35
class Solution {
46
public:
57
int numWays(int n, int k) {
@@ -20,6 +22,7 @@ class Solution {
2022

2123
// Time: O(n)
2224
// Space: O(n)
25+
// DP solution.
2326
class Solution2 {
2427
public:
2528
int numWays(int n, int k) {

0 commit comments

Comments
 (0)