Collatz Conjecture - which is more efficient?
I was given this challenge: Get a starting number, then form a sequence by these rules: 1. If the number is even, divide it by two 2. If the number is odd, multiply it by 3 and add 1 3. Continue sequence until you reach 1 and and at that point, state that you've reached one and give how many steps it took. Without looking at the sample first, I came up with something quite a bit different but the results are identical. I know this is a small code and really, it won't matter, but I think it is important to learn early on which codes are cleaner, more efficient, and would run faster. I'd appreciate any input those with more experience would like to give. Version 1: https://code.sololearn.com/cPIYc3MhZqHc/?ref=app Version 2: https://code.sololearn.com/crCRAPAhVXJ8/?ref=app