Created
June 13, 2019 08:09
-
-
Save stabgan/3bfe8b23acc941876989ea53fde6e371 to your computer and use it in GitHub Desktop.
Checking condition in an infinitely nested loop with BFA search , implemented in python
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
a = [[1,2,[3,4,5]],6,[7,[8,9,10,[11,12,13]]]] | |
def qq(a) : | |
current = a | |
next = [] | |
while (current or current == 0) : | |
if(type(current) is int and current > 7) : | |
return current | |
if(type(current) is list ) : | |
for i in current : | |
next.append(i) | |
current = next[0] | |
next = next[1:] | |
return "Nope" | |
print(qq(a)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Javascript :
current = next.shift()