Hello, checkiomates🐱👤!
This week's digest dives into algorithms and visualization, starting with a look at the Flood Fill algorithm for grid traversal. We then explore how to create stunning mathematical animations with Manim and clean up code by identifying unnecessary parentheses. Our mission challenges your algorithmic thinking to find the area of the largest rectangle in a histogram.
💡TIP
You may click on any mission tag and see all missions, where this tag is present! If you want to discover all CheckiO features, visit our tutorial. It's a longread, but it's worth it!
🏁 MISSION
Largest Rectangle in a Histogram by oduvan -
You have a histogram. Try to find the size of the biggest rectangle you can build out of the histogram bars.
largest_histogram([5]) == 5 largest_histogram([5, 3]) == 6 largest_histogram([1, 1, 4, 1]) == 4
📖 ARTICLES
Floodfill algorithm in Python -
The floodfill algorithm is used to fill a color in a bounded area. Learn how it works and how to implement it in Python.
Manim: Create Mathematical Animations Like 3Blue1Brown Using Python -
Learn how to use Manim, the animation engine, to create clear and compelling visual explanations with Python. This walkthrough shows how you can turn equations and concepts into smooth animations for data science storytelling.
Unnecessary parentheses in Python -
Python’s ability to use parentheses for grouping can often confuse new Python users into over-using parentheses in ways that they shouldn’t be used.
👩💻CODE SHOT
What do you think the following code does?
def checkio(heights: list[int]) -> bool:
return sum(max(heights[max(0, i - 1):i + 2]) == h for i, h in enumerate(heights)) > 1
🙌 Thanks for your attention! Hope to meet you at CheckiO, as well as at our Instagram and Twitter! We are really interested in your thoughts! Please, leave a comment below! ⤵
