From 376bec88eff12bc87dffd23baabd5793788ac588 Mon Sep 17 00:00:00 2001 From: MoriSummer <54202741+coderhare@users.noreply.github.com> Date: Tue, 27 Apr 2021 15:13:00 +0800 Subject: [PATCH] =?UTF-8?q?Update=20leetcode560=E5=92=8C=E4=B8=BAK?= =?UTF-8?q?=E7=9A=84=E5=AD=90=E6=95=B0=E7=BB=84.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- animation-simulation/前缀和/leetcode560和为K的子数组.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/animation-simulation/前缀和/leetcode560和为K的子数组.md b/animation-simulation/前缀和/leetcode560和为K的子数组.md index 0b5cf13..cf52022 100644 --- a/animation-simulation/前缀和/leetcode560和为K的子数组.md +++ b/animation-simulation/前缀和/leetcode560和为K的子数组.md @@ -164,7 +164,7 @@ public: //细节,这里需要预存前缀和为 0 的情况,会漏掉前几位就满足的情况 //例如输入[1,1,0],k = 2 如果没有这行代码,则会返回0,漏掉了1+1=2,和1+1+0=2的情况 //输入:[3,1,1,0] k = 2时则不会漏掉 - //因为presum[3] - presum[0]表示前面 3 位的和,所以需要map.put(0,1),垫下底 + //因为presum[3] - presum[0]表示前面 3 位的和,所以需要m.insert({0,1}),垫下底 m.insert({0, 1}); int count = 0; int presum = 0;