Skip to content

Commit bcc266f

Browse files
committed
auto commit
1 parent a4cb958 commit bcc266f

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

notes/Leetcode 题解.md

-10
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,9 @@
5757

5858
## 双指针
5959

60-
<<<<<<< HEAD
6160
双指针主要用于遍历数组,两个指针指向不同的元素,从而协同完成任务。
6261

6362
**有序数组的 Two Sum**
64-
=======
65-
保证每次操作都是局部最优的,并且最后得到的结果是全局最优的。
66-
67-
**分配饼干**
68-
>>>>>>> b6156c4247f05d29a65564f0e337545fde70fea1
6963

7064
[Leetcode :167. Two Sum II - Input array is sorted (Easy)](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/description/)
7165

@@ -76,11 +70,7 @@ Output: index1=1, index2=2
7670

7771
题目描述:在有序数组中找出两个数,使它们的和为 target。
7872

79-
<<<<<<< HEAD
8073
使用双指针,一个指针指向值较小的元素,一个指针指向值较大的元素。指向较小元素的指针从头向尾遍历,指向较大元素的指针从尾向头遍历。
81-
=======
82-
给一个孩子的饼干应当尽量小又能满足该孩子,这样大饼干就能拿来给满足度比较大的孩子。因为最小的孩子最容易得到满足,所以先满足最小的孩子。
83-
>>>>>>> b6156c4247f05d29a65564f0e337545fde70fea1
8474

8575
- 如果两个指针指向元素的和 sum == target,那么得到要求的结果;
8676
- 如果 sum > target,移动较大的元素,使 sum 变小一些;

0 commit comments

Comments
 (0)