From ab5a97acc8329691d938f2b580c219cfe88df071 Mon Sep 17 00:00:00 2001 From: fiatcode Date: Wed, 18 Feb 2026 12:59:01 +0700 Subject: [PATCH] GREEN: Implement feature to ignore numbers > 1000 - Added .where((n) => n <= 1000) filter - Numbers greater than 1000 now excluded from sum - Tests pass: '2,1001' returns 2, '1000,1001,2' returns 1002 --- lib/string_calculator.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/string_calculator.dart b/lib/string_calculator.dart index 934878c..9f7bc8c 100644 --- a/lib/string_calculator.dart +++ b/lib/string_calculator.dart @@ -37,6 +37,7 @@ class StringCalculator { .split(delimiter) .where((s) => s.isNotEmpty) .map((s) => int.parse(s)) + .where((n) => n <= 1000) // Filter out numbers > 1000 .toList(); // Bug 3: Off-by-one in summation