@@ -0,0 +1,483 @@
+package leetcode.best_time_to_buy_and_sell_stock;%0D%0A%0D%0Apublic class Solution %7B%0D%0A%09public int maxProfit(int%5B%5D prices) %7B%0D%0A%09%09int ret = 0;%0D%0A%09%09if(prices.length == 0) return 0;%0D%0A%09%09int min = prices%5B0%5D, max = prices%5B0%5D;%0D%0A        for(int x : prices)%7B%0D%0A        %09if(min %3E x)%7B%0D%0A        %09%09min = x;%0D%0A        %09%09max = x;%0D%0A        %09%7D%0D%0A        %09if(max %3C x)%7B%0D%0A        %09%09max = x;%0D%0A        %09%7D%0D%0A        %09if(max - min %3E ret)%7B%0D%0A        %09%09ret = max - min;%0D%0A        %09%7D%0D%0A        %7D%0D%0A        return ret;%0D%0A    %7D%0D%0A%7D%0D%0A

Add java solution for 121. Best Time to Buy and Sell Stock