Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def test_pipes(pipes):
  2. tallest_pipe = max(pipes)
  3. capacity = 0
  4. for y in range(1, tallest_pipe + 1):
  5. possible_capacity = 0
  6. start = False
  7. for pipe in pipes:
  8. blah = pipe >= y
  9. if not start:
  10. start = blah
  11. else:
  12. if blah:
  13. capacity += possible_capacity
  14. possible_capacity = 0
  15. else:
  16. possible_capacity += 1
  17. return capacity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement