title: Need help manipulating an array in ruby
body: <p>I'm trying to find the the best time to buy and sell these "stocks". For instance in array "f" buying on 3 and selling at 15 would = maximum_profit. I'm struggling to figure this out, starting to feel slightly dumb. I need to iterate through the array and find the best combo but once I pass a "day" I cant sell it on a day before that, only after.  </p>
  
  <pre><code> a = [1, 2, 3, 4, 5, 6, 7, 8, 9] 
   b = [9, 8, 7, 6, 5, 4, 3, 2, 1] 
   c = [3, 4, 2, 6, 7, 4, 9, 8, 5] 
   d = [8, 6, 9, 2, 7, 4, 1, 5 ,1] 
   e = [10, 11, 2, 9, 4, 3, 5, 6] 
   f = [17, 3, 6, 9, 15, 8, 6, 1, 10] 
  
   def stock_picker(array)
     min = array.min
     min_price= array.index(min)
     max = array.max
     max_price = array.index(max)
  
   end
  
   stock_picker(a)
  </code></pre>