Created
March 4, 2020 18:00
-
-
Save deque-blog/170a24c53d02e1eef71703aa04ae50a9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 expand_selection(self, states: Set[int]): | |
expanded = set() | |
to_expand = list(states) | |
while to_expand: | |
s = to_expand.pop() | |
expanded.add(s) | |
if s < len(self.nodes) and self.stars[s]: | |
if s+1 not in expanded: | |
states.add(s+1) | |
to_expand.append(s+1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment