My task was to write 3 methods.
- Caesar cipher that takes in a string and the shift factor and then outputs the modified string.
- 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.
- Substrings that takes a word as the first argument and then an array of valid substrings (your dictionary) as the second argument. It should return a hash listing each substring (case insensitive) that was found in the original string and how many times it was found.
I wrote also tests (rspec) for them. Firstly, I used old version (with "should"). Later I learned about new documentation and I refactored test for Caesar cipher.
The Odin Project, http://www.theodinproject.com/ruby-programming/building-blocks