Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def delivery(order, shoppers)
- output = Array.new
- x = 0
- while (x < shoppers.length)
- fulfill_order_time = (shoppers[x][0] + order[0]) / shoppers[x][1].to_f + shoppers[x][2]
- if fulfill_order_time >= order[1] and order[1] + order[2] >= fulfill_order_time then
- output[x] = true
- else
- output[x] = false
- end
- x = x + 1
- end
- return output
- end
Add Comment
Please, Sign In to add comment