Skip to content

Instantly share code, notes, and snippets.

@stabgan
Created June 13, 2019 08:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stabgan/3bfe8b23acc941876989ea53fde6e371 to your computer and use it in GitHub Desktop.
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
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))
@stabgan
Copy link
Author

stabgan commented Jun 14, 2019

Javascript :
current = next.shift()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment