- reduce duplicate queue entries by not appending to the queue if a
point has a nonzero count. (if there's a count then it must have
already been queued.)
- use the correct data structure for a double-ended queue so pop(0) has
less work to do
- factor out the list of summits
of these three changes, only the last one has any noticable effect
on the run time. 🤷
instead of lists, construct a tower of nested generators. i think this
is equivalent to a recursive backtracking solution.
since the input doesn't contain 0 we can check for <goal in the
intermediate layers, and ==goal at the end.