We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Dynamic programming (or memoization) and indeterminism!
If we suppose n_ways(A, d) to be a function that returns the total number of distinct ways in distance d from ANY house in a set A, we can compute it recursively:
Clues on a Binary Path
You are viewing a single comment's thread. Return to all comments →
Dynamic programming (or memoization) and indeterminism!
If we suppose n_ways(A, d) to be a function that returns the total number of distinct ways in distance d from ANY house in a set A, we can compute it recursively:
where reach(A, c) gives the set of all houses that can be reached from ANY house in A with given clue (c = 0 or 1).
Then, memoizing n_ways() based on different A and d can boost the performance.