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 d83ea7a commit 97e8256Copy full SHA for 97e8256
算法/题解-剑指Offer.md
@@ -702,9 +702,9 @@ public:
702
int lo = 0;
703
int hi = rotateArray.size() - 1;
704
705
- // 完全旋转,或者说没有旋转(不需要)
706
- //if (rotateArray[lo] < rotateArray[hi])
707
- // return rotateArray[lo];
+ // 完全旋转,或者说没有旋转(需要, e.g {1, 2})
+ if (rotateArray[lo] < rotateArray[hi])
+ return rotateArray[lo];
708
709
while (lo + 1 < hi) {
710
int mid = lo + (hi - lo) / 2;
0 commit comments