Advertisement
Centipede18

avoidObstacles

Apr 5th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def avoidObstacles(a):
  2.     for i in range(2, max(a)+2):
  3.         n = 0
  4.         while n < max(a):
  5.             n += i
  6.             c = True
  7.             if n in a:
  8.                 c = False
  9.                 break
  10.         if c:
  11.             return i
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement