-
Convert Collatz Conjecture From String To Number And Back Using Python Pointers
Hello, checkiomates🐱👤!
Welcome to this week's edition of our news email digest! Get ready to dive into the coding challenge and explore fascinating article about Python. Are you ready to sharpen your coding skills and expand your knowledge?
💡TIP:
If you find an interesting solution, you may add it to your bookmarks by clicking the flag near solution title. You can find all your bookmarked solutions by clicking your nickame and then "Bookmarks". If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!
🏁MISSION:
Collatz Ztalloc by freeman_lex - 🚀Embark on a Mathematical Odyssey with the Collatz Conjecture in Binary! 🧮
Step into the captivating realm of Collatz, where numbers pirouette in a mesmerizing binary dance of "up" and "down" transitions. Your challenge: craft a Python function that decodes the starting value from strings of "u"s and "d"s or unveils the shape of steps from a given value. But beware! Not all shapes are plausible according to Collatz rules. Navigate this mathematical labyrinth with precision, ensuring your function rejects the impossible shapes and returns None. Are you ready to crack the code and unravel the mysteries of this captivating mathematical puzzle? Join the adventure now! 💫
collatz_convert("ududududddddudddd") == 15 collatz_convert(135) == "udududduddddududdudduddddudududdudddudddd" collatz_convert("dudududdudddudddd") == 14
📖ARTICLE:
Does Python have pointers? - For your attention is informative and educational article from Ned Batchelder about author's understanding of pointers in Python in comparison with some other languages.
👩💻CODE SHOT:
How do you think, what the following code does?
def ??????????(arr: list[str]) -> str: p=arr[0] for t in arr[1:]: while not t.startswith(p): p=p[:-1] return p
🙌 Thanks for your attention! Hope to meet you at CheckiO. We are really interested in your thoughts! Please, leave a comment below! ⤵
Welcome to CheckiO - games for coders where you can improve your codings skills.
The main idea behind these games is to give you the opportunity to learn by exchanging experience with the rest of the community. Every day we are trying to find interesting solutions for you to help you become a better coder.
Join the Game