mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-10-31 11:05:36 +00:00
Update Leetcode 题解 - 二分查找.md
题目链接统一为 leetcode.cn。
This commit is contained in:
@@ -102,7 +102,7 @@ l m h
|
||||
|
||||
69\. Sqrt(x) (Easy)
|
||||
|
||||
[Leetcode](https://leetcode.com/problems/sqrtx/description/) / [力扣](https://leetcode-cn.com/problems/sqrtx/description/)
|
||||
[Leetcode](https://leetcode.com/problems/sqrtx/description/) / [力扣](https://leetcode.cn/problems/sqrtx/description/)
|
||||
|
||||
```text
|
||||
Input: 4
|
||||
@@ -142,7 +142,7 @@ public int mySqrt(int x) {
|
||||
|
||||
744\. Find Smallest Letter Greater Than Target (Easy)
|
||||
|
||||
[Leetcode](https://leetcode.com/problems/find-smallest-letter-greater-than-target/description/) / [力扣](https://leetcode-cn.com/problems/find-smallest-letter-greater-than-target/description/)
|
||||
[Leetcode](https://leetcode.com/problems/find-smallest-letter-greater-than-target/description/) / [力扣](https://leetcode.cn/problems/find-smallest-letter-greater-than-target/description/)
|
||||
|
||||
```text
|
||||
Input:
|
||||
@@ -180,7 +180,7 @@ public char nextGreatestLetter(char[] letters, char target) {
|
||||
|
||||
540\. Single Element in a Sorted Array (Medium)
|
||||
|
||||
[Leetcode](https://leetcode.com/problems/single-element-in-a-sorted-array/description/) / [力扣](https://leetcode-cn.com/problems/single-element-in-a-sorted-array/description/)
|
||||
[Leetcode](https://leetcode.com/problems/single-element-in-a-sorted-array/description/) / [力扣](https://leetcode.cn/problems/single-element-in-a-sorted-array/description/)
|
||||
|
||||
```text
|
||||
Input: [1, 1, 2, 3, 3, 4, 4, 8, 8]
|
||||
@@ -221,7 +221,7 @@ public int singleNonDuplicate(int[] nums) {
|
||||
|
||||
278\. First Bad Version (Easy)
|
||||
|
||||
[Leetcode](https://leetcode.com/problems/first-bad-version/description/) / [力扣](https://leetcode-cn.com/problems/first-bad-version/description/)
|
||||
[Leetcode](https://leetcode.com/problems/first-bad-version/description/) / [力扣](https://leetcode.cn/problems/first-bad-version/description/)
|
||||
|
||||
题目描述:给定一个元素 n 代表有 [1, 2, ..., n] 版本,在第 x 位置开始出现错误版本,导致后面的版本都错误。可以调用 isBadVersion(int x) 知道某个版本是否错误,要求找到第一个错误的版本。
|
||||
|
||||
@@ -248,7 +248,7 @@ public int firstBadVersion(int n) {
|
||||
|
||||
153\. Find Minimum in Rotated Sorted Array (Medium)
|
||||
|
||||
[Leetcode](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/description/) / [力扣](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/description/)
|
||||
[Leetcode](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/description/) / [力扣](https://leetcode.cn/problems/find-minimum-in-rotated-sorted-array/description/)
|
||||
|
||||
```text
|
||||
Input: [3,4,5,1,2],
|
||||
@@ -280,7 +280,7 @@ public int findMin(int[] nums) {
|
||||
|
||||
34\. Find First and Last Position of Element in Sorted Array (Medium)
|
||||
|
||||
[Leetcode](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) / [力扣](https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/)
|
||||
[Leetcode](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/) / [力扣](https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/)
|
||||
|
||||
```text
|
||||
Input: nums = [5,7,7,8,8,10], target = 8
|
||||
|
||||
Reference in New Issue
Block a user