Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: correct typo "util" to "until" (TheAlgorithms#12653)
  • Loading branch information
kimtth authored Apr 9, 2025
commit a4576dc2a42cbfc7585a7ce6f28917cb97f83c45
6 changes: 3 additions & 3 deletions dynamic_programming/bitmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def count_ways_until(self, mask, task_no):
return self.dp[mask][task_no]

# Number of ways when we don't this task in the arrangement
total_ways_util = self.count_ways_until(mask, task_no + 1)
total_ways_until = self.count_ways_until(mask, task_no + 1)

# now assign the tasks one by one to all possible persons and recursively
# assign for the remaining tasks.
Expand All @@ -54,10 +54,10 @@ def count_ways_until(self, mask, task_no):

# assign this task to p and change the mask value. And recursively
# assign tasks with the new mask value.
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)

# save the value.
self.dp[mask][task_no] = total_ways_util
self.dp[mask][task_no] = total_ways_until

return self.dp[mask][task_no]

Expand Down