From 1f60c387d0a8ebbc5c4dc9eea852174d487c669c Mon Sep 17 00:00:00 2001 From: ljy5490 Date: Wed, 10 Feb 2021 09:57:15 +0000 Subject: [PATCH] Fix bug in maxMirror --- java/array-3/maxMirror.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/array-3/maxMirror.java b/java/array-3/maxMirror.java index 365db17..2c9416e 100644 --- a/java/array-3/maxMirror.java +++ b/java/array-3/maxMirror.java @@ -14,7 +14,8 @@ public int maxMirror(int[] nums) { count++; } else { max = Math.max(max, count); - count = 0; + j += count; + count = 0; } }