Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit166d265

Browse files
authored
Update 1968-array-with-elements-not-equal-to-average-of-neighbors.cpp
1 parentfd121a5 commit166d265

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎cpp/1968-array-with-elements-not-equal-to-average-of-neighbors.cpp

Lines changed: 4 additions & 1 deletion
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)

[8]ページ先頭

©2009-2025 Movatter.jp