Binary Decision Diagrams (2010)
List all 5-letter words that remain words after replacing a b with o. How can we solve these efficiently?Put them in a set(), then iterate over its members and report any that contain b and are still in the set after the string replacement. O(n), which can't be beaten.Edit: If you're downvoting, could you post a comment saying why?