Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def reorderingOfProducts(boundaries, y):
- array_length = len(boundaries)
- x = 0
- new_array = []
- while (x < array_length - 1):
- new_array.append((boundaries[x] + boundaries[x + 1]) / 2)
- x = x + 1
- x = 0
- array_length = len(new_array)
- while (x < array_length):
- print new_array[x]
- if new_array[x] >= y:
- return x
- else:
- x = x + 1
- return x
Advertisement
Add Comment
Please, Sign In to add comment