From b841165037769a1a8f62b1231ec62a323c91a2fc Mon Sep 17 00:00:00 2001 From: me Date: Tue, 17 Feb 2026 13:00:07 +0300 Subject: [PATCH] update 3637 mod solution --- java/search/BinarySearch3637.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/java/search/BinarySearch3637.java b/java/search/BinarySearch3637.java index 713347c..70477e6 100644 --- a/java/search/BinarySearch3637.java +++ b/java/search/BinarySearch3637.java @@ -15,10 +15,9 @@ public class BinarySearch3637 { a.put(Integer.parseInt(args[i])); } - System.out.println( - searchIterativeIncreasing(x, a.getReversed()) - - searchIterativeDecreasing(x, a) - ); + int start = searchIterativeDecreasing(x, a); + int end = searchIterativeIncreasing(x, a.getReversed()); + System.out.println(((end - start) == -1) ? 0 : (end - start)); } static int searchIterativeIncreasing(int x, IntList a) {