You have to take care of only minimum value and maximum profit. var maxProfit = function(prices) { // edge case if(prices.length < 1) return; // logic let min = prices[0]; let maxProfit = 0; for(let i = 0; i < prices.length ...
bishalshaw.hashnode.dev1 min readNo responses yet.