Go clean solution beats 100% runtime
\nfunc maxProfit(prices []int) int {\n    var profit = 0\n    var minPrice = prices[0]\n    \n    for i := 1; i < len(prices); i++ {\n        // If we find any 
```\nfunc maxProfit(prices []int) int {\n    var profit = 0\n    var minPrice = prices[0]\n    \n    for i := 1; i < len(prices); i++ {\n        // If we find any price which is lower than the current minPrice\n        // update the minPrice\n        if prices[i] < minPrice {\n            minPrice = prices[i]\n        } else if (prices[i] - minPrice) > profit {\n            // If diff of current stock with minPrice is greater\n            // update the profit\n            profit = prices[i] - minPrice\n        }\n    }\n    \n    return profit\n}\n```
['Go']