Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 407 Bytes

README.md

File metadata and controls

12 lines (9 loc) · 407 Bytes

#Stock Picker

Implement a method #stock_picker that takes in an array of stock prices, one for each hypothetical day. It should return a pair of days representing the best day to buy and the best day to sell. Days start at 0.

> stock_picker([17,3,6,9,15,8,6,1,10])
=> [1,4]  # for a profit of $15 - $3 == $12

The Odin Project