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

Commit b894b32

Browse files
Create Readme.md
1 parent 85b1118 commit b894b32

File tree

1 file changed

+3
-0
lines changed
  • Greedy/3696.Maximum-Distance-Between-Unequal-Words-in-Array-I

1 file changed

+3
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### 3696.Maximum-Distance-Between-Unequal-Words-in-Array-I
2+
3+
此题有非常巧妙的贪心法。如果首尾元素不同,那么答案就是n。如果首尾元素不同,那么答案必然是在以下两种可能之中:首元素与某个与其不相同的元素;或者尾元素与某个与其不相同的元素。所以两遍one pass即可。

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /