Skip to content

Commit 166d265

Browse files
authored
Update 1968-array-with-elements-not-equal-to-average-of-neighbors.cpp
1 parent fd121a5 commit 166d265

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: cpp/1968-array-with-elements-not-equal-to-average-of-neighbors.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ class Solution {
66
int a=nums[i-1];
77
int b=nums[i];
88
int c=nums[i+1];
9-
if(a>b && b>c || a<b && b<c) swap(nums[i],nums[i+1]);
9+
if(a>b && b>c || a<b && b<c)
10+
{
11+
swap(nums[i],nums[i+1]);
12+
}
1013
}
1114
return nums;
1215
}

0 commit comments

Comments
 (0)