public static void main(String args[]){
        int arr[] = {7,10,15,5,11,2,7,9,3};
        int arr1[] = {6,4,1,3,5,7,3,1,3,4,7,9,2,5,6,0,1,2};
        BuySellStockProfit bss = new BuySellStockProfit();
        System.out.println(bss.oneProfit(arr));
        System.out.print(bss.allTimeProfit(arr1));
        
    }
Date 03/04/2016
@author Tushar Roy

Best time to buy and sell stocks.
1) Only 1 transaction is allowed
2) Infinite number transactions are allowed

Time complexity O(n)
Space complexity O(1)

https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/
src/com/interview/array/BuySellStockProfit.java