From 53b7ecd02d32dcec3fbe63821da3b18b39deae89 Mon Sep 17 00:00:00 2001 From: miguel Date: Wed, 18 Dec 2024 17:03:30 +0000 Subject: [PATCH] fix(fromto): improve solution --- solutions/fromto.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solutions/fromto.go b/solutions/fromto.go index 4d10eb68..a309ec57 100644 --- a/solutions/fromto.go +++ b/solutions/fromto.go @@ -7,8 +7,8 @@ func FromTo(from, to int) string { if from > 99 || from < 0 || to > 99 || to < 0 { return "Invalid\n" - } else if from == to { - return strconv.Itoa(from) + "\n" + } else if from == to && from < 10 { + return "0" + strconv.Itoa(from) + "\n" } if from > to { for i := from; i >= to; i-- {