From 407fe97b21e6ec0bc84761d293e25b2557cc7a49 Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Fri, 17 May 2019 22:26:23 +0800 Subject: [PATCH] auto commit --- docs/notes/剑指 Offer 题解 - 50~59.md | 4 ++-- notes/剑指 Offer 题解 - 50~59.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/notes/剑指 Offer 题解 - 50~59.md b/docs/notes/剑指 Offer 题解 - 50~59.md index 42de538a..ae907d4f 100644 --- a/docs/notes/剑指 Offer 题解 - 50~59.md +++ b/docs/notes/剑指 Offer 题解 - 50~59.md @@ -101,11 +101,11 @@ private void merge(int[] nums, int l, int m, int h) { tmp[k] = nums[j++]; else if (j > h) tmp[k] = nums[i++]; - else if (nums[i] < nums[j]) + else if (nums[i] <= nums[j]) tmp[k] = nums[i++]; else { tmp[k] = nums[j++]; - this.cnt += m - i + 1; // nums[i] >= nums[j],说明 nums[i...mid] 都大于 nums[j] + this.cnt += m - i + 1; // nums[i] > nums[j],说明 nums[i...mid] 都大于 nums[j] } k++; } diff --git a/notes/剑指 Offer 题解 - 50~59.md b/notes/剑指 Offer 题解 - 50~59.md index 2d3f3d22..51e4a810 100644 --- a/notes/剑指 Offer 题解 - 50~59.md +++ b/notes/剑指 Offer 题解 - 50~59.md @@ -101,11 +101,11 @@ private void merge(int[] nums, int l, int m, int h) { tmp[k] = nums[j++]; else if (j > h) tmp[k] = nums[i++]; - else if (nums[i] < nums[j]) + else if (nums[i] <= nums[j]) tmp[k] = nums[i++]; else { tmp[k] = nums[j++]; - this.cnt += m - i + 1; // nums[i] >= nums[j],说明 nums[i...mid] 都大于 nums[j] + this.cnt += m - i + 1; // nums[i] > nums[j],说明 nums[i...mid] 都大于 nums[j] } k++; }