LeetCode: Best Time to Buy and Sell Stock II
Performance

Your solution is a single pass with time complexity \$O(n)\$. It's a small variation of the proposed solution. 

Conventions


use static when no instance state/operations are used
use a clear, non-abbreviated method name CalculateMaximumProfit
always guard against bad user input in public methods
prefer the use of var when the type is obvious when reading the code
prefer whitespace between operands and operators prices.Length - 1
clean up waisted whitespace (in this case, after the return statement)


applied to your code:

 public static int CalculateMaximumProfit(int[] prices)
 {
     prices = prices ?? throw new ArgumentNullException(nameof(prices));
     var max = 0;
     for (var i = 0; i &lt; prices.Length - 1; i++)
     {
         if (prices[i] &lt; prices[i + 1])
         {
             max += prices[i + 1] - prices[i];
         }
     }
     return max;
 }