From 77d48e790a14d3b6531dea8515d9cbfe193bbf5c Mon Sep 17 00:00:00 2001 From: fiatcode Date: Wed, 18 Feb 2026 12:56:40 +0700 Subject: [PATCH] GREEN: Fix single number parsing bug - Removed +1 off-by-one error from single number parsing - Now correctly returns the parsed number - Tests pass: '5' returns 5, '42' returns 42 --- lib/string_calculator.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/string_calculator.dart b/lib/string_calculator.dart index bb7e714..763c5b6 100644 --- a/lib/string_calculator.dart +++ b/lib/string_calculator.dart @@ -17,7 +17,7 @@ class StringCalculator { // Bug 2: Single number parsing if (!numbers.contains(',') && !numbers.contains('\n') && !numbers.startsWith('//')) { - return int.parse(numbers) + 1; // Off by one error + return int.parse(numbers); // Fixed: Removed off-by-one error } String delimiter = ',';