<div dir="auto">With a minor pre-processing of the inputs, there's a O(n) solution with code (in python) on Wikipedia.  :)<div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 7, 2019, 18:57 Travis Risner <<a href="mailto:deeppunster@gmail.com">deeppunster@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here is a small problem for us to consider.  At tonight’s DoJo meeting <br>
we will work together to solve this as individuals or small groups.  We <br>
will also discuss the advantages of each approach.<br>
<br>
        Given a array of numbers representing the stock prices of a company in<br>
        chronological order, write a function that calculates the maximum <br>
profit you<br>
        could have made from buying and selling that stock once. You must buy <br>
before<br>
        you can sell it.<br>
<br>
        For example, given [9, 11, 8, 5, 7, 10], you should return 5, since you<br>
        could buy the stock at 5 dollars and sell it at 10 dollars.<br>
<br>
DoJo is at Smokehouse Brewing, 1130 Dublin Road, Columbus, Ohio.  Join <br>
us at 6:00 or any time after that!<br>
<br>
Travis<br>
_______________________________________________<br>
CentralOH mailing list<br>
<a href="mailto:CentralOH@python.org" target="_blank" rel="noreferrer">CentralOH@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/centraloh" rel="noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/centraloh</a><br>
</blockquote></div>