Given a day's buy and sell orders for one stock as (amount, time) pairs, with the position starting and ending at 0, compute the average time a share is held.
Unlock detailed company stats for this questionUpgrade
For one account and one stock you are given a day's list of buy and sell orders as (amount, time) pairs. The position starts at 0, ends at 0 and may go negative in between. Write code that computes the average time for which a share is held.
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
