Shortest path to collect all keys
A grid has walls, a start cell, keys (lowercase letters) and locks (the matching uppercase letters). A lock can only be passed once you hold its key. Return the fewest steps to collect every key, or -1. Run a breadth-first search over states made of the position and the set of keys held, stored as a bitmask.
No answer yet. Write the first one; the best answer gets endorsed.
