We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 91d30c5 commit 3222657Copy full SHA for 3222657
C++/minimum-average-difference.cpp
@@ -11,7 +11,7 @@ class Solution {
11
for (int i = 0; i < size(nums); ++i) {
12
prefix += nums[i];
13
const int a = prefix / (i + 1);
14
- const int b = (i + 1 < size(nums) ? (total - prefix) / (size(nums) - (i + 1)) : 0);
+ const int b = i + 1 < size(nums) ? (total - prefix) / (size(nums) - (i + 1)) : 0;
15
int diff = abs(a - b);
16
if (diff < mn) {
17
mn = diff;
0 commit comments