We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
That's O(n^2) since you're finding the max value on each iteration of the where statement. The best solution would be to use a single for/foreach loop, but jeffmagill's solution (looping through the list twice) is still much more efficient than this.
Birthday Cake Candles
You are viewing a single comment's thread. Return to all comments →
That's O(n^2) since you're finding the max value on each iteration of the where statement. The best solution would be to use a single for/foreach loop, but jeffmagill's solution (looping through the list twice) is still much more efficient than this.