Skip to content

Commit b894b32

Browse files
authored
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)