added O(n log n) solution to MaxProfit problem