Skip to content

CodePlatoon/algo-stock-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Stock Picker 1234

For this challenge you need to implement a method #stock_picker that takes in an list 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.

Considerations

  • You need to buy before you can sell
  • Pay attention to edge cases like when the lowest day is the last day or the highest day is the first day.
  • Make sure you translate the driver code in the spec file to Unittest and Jest tests.

Example

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •