Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct typo "util" to "until" #12653

Merged
merged 2 commits into from
Apr 9, 2025
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
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