The Python ๐Ÿ problem-solving bootcamp ๐Ÿš€ is starting soon. Join the second cohort now!

Mathspp Blog

317 359,717 30,716
articles words lines of code

Today I learned not to cache generators.

It's night time and 4 friends need to cross a fragile bridge, but they only have one torch. What's the order in which they should cross?

You are sunbathing when you decide to go and talk to some friends under a nearby sun umbrella, but first you want to get your feet wet in the water. What is the most efficient way to do this?

Let's prove that if you want to maximise \(ab\) with \(a + b\) equal to a constant value \(k\), then you want \(a = b = \frac{k}{2}\).