Last active
November 23, 2017 00:03
-
-
Save lukegrecki/2f6bcef0213185d7c2e7a6a032c98c2f to your computer and use it in GitHub Desktop.
Determine if adding a new node would be a valid extension given a dictionary of dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_valid_extension(visited_nodes, new_node, dependencies): | |
if dependencies.get(new_node) and dependencies.get(new_node) not in visited_nodes: | |
return False | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment