1 parent 5afe029 commit a4576dcCopy full SHA for a4576dc
1 file changed
dynamic_programming/bitmask.py
@@ -42,7 +42,7 @@ def count_ways_until(self, mask, task_no):
42
return self.dp[mask][task_no]
43
44
# Number of ways when we don't this task in the arrangement
45
- total_ways_util = self.count_ways_until(mask, task_no + 1)
+ total_ways_until = self.count_ways_until(mask, task_no + 1)
46
47
# now assign the tasks one by one to all possible persons and recursively
48
# assign for the remaining tasks.
@@ -54,10 +54,10 @@ def count_ways_until(self, mask, task_no):
54
55
# assign this task to p and change the mask value. And recursively
56
# assign tasks with the new mask value.
57
- total_ways_util += self.count_ways_until(mask | (1 << p), task_no + 1)
+ total_ways_until += self.count_ways_until(mask | (1 << p), task_no + 1)
58
59
# save the value.
60
- self.dp[mask][task_no] = total_ways_util
+ self.dp[mask][task_no] = total_ways_until
61
62
63
0 commit comments