Saurabh Aggarwal
unread,Sep 9, 2009, 2:28:16 AM9/9/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ds--al...@googlegroups.com
The price of a particular stock on different days is given in an array.
e.g. if array is: 1, 8, 2, 10
Price of stock on Day 1 = 1
Price of stock on Day 2 = 8 & so on ..
On any day, you may buy 1 stock, sell 1 stock or do nothing.
What is the maximum profit that you can earn.
(In above example, you buy stock on Day 1, sell it on Day 2, buy on Day 3, sell on Day 4, so maximum profit = 15)
--
Regards,
Saurabh Aggarwal