On the Collatz Conjecture II
I've written about the Collatz Conjecture before, right here: https://anothercasualcoder.blogspot.com/2019/05/on-collatz-conjecture.html Coincidentally, this LC problem talks about it. Here it is: https://leetcode.com/problems/sort-integers-by-the-power-value/ 1387. Sort Integers by The Power Value Medium 16 0 Add to List Share The power of an integer x is defined as the number of steps needed to transform x into 1 using the following steps: if x is even then x = x / 2 if x is odd then x = 3 * x + 1 For example, the power of x = 3 is 7 because 3 needs 7 steps to become 1 (3 --> 10 --> 5 --> 16 --> 8 --> 4 --> 2 --> 1). Given three integers lo , hi and k . The task is to sort all integers in the interval [lo, hi] by the power value in ascending order , if two or more integers have the same power value so...