Skip to content

Commit e655564

Browse files
committed
Update to more pythonic template
1 parent e849691 commit e655564

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
def fn(arr):
2+
@cache
23
def dp(STATE):
34
if BASE_CASE:
45
return 0
5-
6-
if STATE in memo:
7-
return memo[STATE]
8-
9-
ans = RECURRENCE_RELATION(STATE)
10-
memo[STATE] = ans
11-
12-
return ans
13-
14-
memo = {}
6+
return RECURRENCE_RELATION(STATE)
157

168
return dp(STATE_FOR_WHOLE_INPUT)

0 commit comments

Comments
 (0)