Skip to content

The project implement's a #stock_picker method that takes in an array of stock prices and returns a pair of days representing the best day to buy and the best day to sell.

License

Notifications You must be signed in to change notification settings

abongsjoel/stock-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stock Picker

In this project, I implemented a simple #stock_picker method

The project implement's a #stock_picker method 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 and we need to buy before we can sell.

E.g.

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

Getting Started

This project is built with Ruby and run at the terminal so in order run it:

  • You start by installing ruby on your computer

Installing Ruby

  • Then you clone the project from githup into a local repository
    git clone git@github.com:abongsjoel/stock-picker.git
    
  • Navigagte into the stock-picker folder
    cd stock-picker
    
  • Run the application using the following command
    ruby main.rb
    
  • Voila
  • Enjoy

Built With

  • Ruby

Live Demo

Repl.it Link

Author

👤 Chi A. Joel

Acknowledgments

Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a ⭐️ if you like this project!

License

This project is MIT licensed.

About

The project implement's a #stock_picker method that takes in an array of stock prices and returns a pair of days representing the best day to buy and the best day to sell.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages