Skip to content

Commit

Permalink
Updating comments
Browse files Browse the repository at this point in the history
  • Loading branch information
derailed-dash committed Jan 13, 2024
1 parent 1d613e6 commit a61baac
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/AoC_2023/Dazbo's_Advent_of_Code_2023.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4861,8 +4861,9 @@
" @cache # to cache, our SpringRecord must be immutable - hence frozen\n",
" def get_arrangements_count(self, char_idx: int, curr_group_idx: int, curr_group_len: int):\n",
" \"\"\" Determine how many arrangements are possible by recursing.\n",
" Move through the record one char at a time. Whenever we reach the end of the record,\n",
" check if it has completed all the groups.\n",
" Move through the record one char at a time. \n",
" Each recursive call depth adds one to the char_idx.\n",
" Whenever we reach the end of the record, check if it has completed all the groups.\n",
" Our inputs represent a minimal state that defines where we are in the record, \n",
" which group we're processing, and the length the current group.\n",
"\n",
Expand All @@ -4887,8 +4888,9 @@
" else: # we have not completed all groups, or current group length is too long\n",
" return 0 # invalid\n",
" \n",
" # Process the current char in the record by recursion\n",
" # Determine valid states for recursion\n",
" # Process from left to right\n",
" # If we're not at the end, process the current char in the record by recursion\n",
" # Determine valid states for recursion by trying . and # at the current char idx\n",
" for char in [\".\", \"#\"]:\n",
" # We can subst char for itself (no change), or for ?\n",
" if self.record[char_idx] in (char, \"?\"): \n",
Expand Down

0 comments on commit a61baac

Please sign in to comment.