Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def test_pipes(pipes):
- tallest_pipe = max(pipes)
- capacity = 0
- for y in range(1, tallest_pipe + 1):
- possible_capacity = 0
- start = False
- for pipe in pipes:
- blah = pipe >= y
- if not start:
- start = blah
- else:
- if blah:
- capacity += possible_capacity
- possible_capacity = 0
- else:
- possible_capacity += 1
- return capacity
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement