Skip to content

Commit

Permalink
Simplify example
Browse files Browse the repository at this point in the history
  • Loading branch information
meatball133 committed Oct 14, 2023
1 parent 2015587 commit 9d042a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exercises/practice/collatz-conjecture/.meta/src/example.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ module CollatzConjecture
n = input
steps = 0
until n == 1
if n % 2 == 0
n = n / 2
if n.divisible_by?(2)
n /= 2
else
n = 3 * n + 1
end

steps = steps + 1
steps += steps
end

steps
Expand Down

0 comments on commit 9d042a0

Please sign in to comment.