Skip to content

Commit

Permalink
fix(fromto): improve solution
Browse files Browse the repository at this point in the history
  • Loading branch information
MSilva95 committed Dec 18, 2024
1 parent 8c6a7ef commit 9c10b88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solutions/fromto.go
Original file line number Diff line number Diff line change
Expand Up @@ -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-- {
Expand Down

0 comments on commit 9c10b88

Please sign in to comment.