Reverse a string in place — no extra array allowed.
The two-pointer trick: L at the start, R at the end. Swap them. Step both inward. Stop when they meet.
Walkthrough on DAILY MATHS → SHTAM YLIAD. Five swaps. The space in the middle (position 5) stays put.
Clean Python code with explicit temp swap. Time O(n) — every character touched once. Extra space O(1) — just two indices and a temp variable.
The same two-pointer pattern shows up in:
• Two-sum on a sorted array
• Palindrome check
• Container with most water
• Removing duplicates in place
One of THE classic patterns to know for coding interviews.
Follow for daily visual math.
Shop: dailymathvisuals.lemonsqueezy.com
Daily Math Visuals
Welcome to @dailymathvisuals, where we transform complex mathematical concepts into stunning, cinematic animations.
Same integrand family. Same upper limit (infinity). Just change one number — the power p — and the area flips between infinite and finite.
∫₁^∞ dx/x diverges. ∫₁^∞ dx/x² = 1 exactly. The two curves look nearly identical at the tail, but one goes to zero just fast enough.
The sharp cutoff is at p = 1. We derive it cleanly, then animate a slider that morphs p from 0.5 to 2.5 and watches the area's verdict snap from infinite to finite at the crossing — with the precision caveat that just past p = 1, the area is
finite but still enormous (at p = 1.05 it's already 20).
The same p = 1 cutoff appears for p-series: Σ 1/n diverges (harmonic), Σ 1/n² = π²/6 (Basel). p = 1 is the critical exponent for power-law tails — for both area and sums.
Follow for daily visual math.
Shop: dailymathvisuals.lemonsqueezy.com
Differentiate y = ln(x² + 1).
Most textbooks just give you the steps. This one shows you why the formula IS the curve's slope.
Treat it as a chain of two machines: x goes through x² + 1, output u goes through ln. The chain rule says dy/dx = dy/du · du/dx. Compute each: dy/du = 1/u, du/dx = 2x. Multiply and substitute back: dy/dx = 2x / (x² + 1).
Now the visual payoff. Plot the curve on top, the derivative on the bottom. Slide a tangent line along the curve — its slope tracks the derivative graph in real time, every single x.
At x = 0, slope is zero (flat). At x = 1, slope is largest positive. At x = −1, most negative.
The formula isn't just symbols. It IS the curve.
Follow for daily visual math.
Shop: dailymathvisuals.lemonsqueezy.com
Can a knight visit EVERY square on a chessboard? 🤯♞
🎨 Get these visuals as 4K wallpapers: patreon.com/dailymathvisuals
This 800-year-old puzzle broke mathematicians' brains... until Euler cracked it.
Watch till the end for the most satisfying pattern reveal ✨
05/31/2026
You can also follow on Instagram to see more.
Around 500 BCE, the Pythagoreans believed every number was a ratio of whole numbers. Then they measured the diagonal of a unit square — that length is √2 — and their worldview broke.
Here's the proof in 90 seconds.
Assume √2 = p/q in lowest terms. Square both sides → p² = 2q². So p² is even, which means p is even. Write p = 2k. Substitute back → q² = 2k². So q² is even, which means q is even.
But we said p and q had NO common factors. They both being even contradicts that. So the assumption was wrong. √2 cannot be a fraction.
Legend says the Pythagorean who proved this was drowned at sea.
Numbers are weirder than they look.
Follow for daily visual math.
Shop: dailymathvisuals.lemonsqueezy.com
Plus and times don't care about order. Function composition usually does.
Quick demo: f(x) = 2x, g(x) = x + 1. Plug in 5.
Do g first, then f: 5 → 6 → 12.
Do f first, then g: 5 → 10 → 11.
Same input. Same two functions. Just swapped the order, and the answer changed.
The geometric version is even cleaner — rotate then translate vs translate then rotate land a letter F in two completely different spots.
In general: f ∘ g ≠ g ∘ f. And that's exactly why matrix multiplication isn't commutative either — AB usually isn't BA.
Follow for daily visual math.
Shop: dailymathvisuals.lemonsqueezy.com
The exam question that made UK students cry on Twitter.
June 2015, GCSE maths. trended for days.
The setup: n sweets in a bag, 6 of them orange, the rest yellow. Hannah eats two without replacement. The probability both are orange is 1/3. Show that n² − n − 90 = 0.
Here's the trick — it looks like a probability problem, but it cleans up into pure algebra.
First pick: 6/n. Second pick (given first was orange): 5/(n−1). Multiply: 30 / (n(n−1)) = 1/3. Cross-multiply: 90 = n² − n. Done.
Bonus: factor it. n = 10. Six orange, four yellow. That's the whole bag.
Follow for daily visual math.
Shop: dailymathvisuals.lemonsqueezy.com
You drive 60 mph one way. Coming back: 40.
Average speed for the whole trip?
Almost everyone says 50. The real answer is 48.
The famous distance-speed-time triangle is fine. The mistake is averaging the two speeds, instead of using what "average speed" actually means: total distance divided by total time.
Use the triangle on each leg. Time = distance / speed. At 60, leg one is 2 hours. At 40, leg two is 3 hours. Total 240 miles, 5 hours → 48 mph.
Bonus: when the distances are equal, the answer is always the harmonic mean — 2·S₁·S₂ / (S₁+S₂).
The slower leg eats more time, so it counts for more.
Follow for daily visual math.
Shop: dailymathvisuals.lemonsqueezy.com
What happens when you bend a spring into a circle? 🌀
You get the Toroidal Spiral - one of mathematics' most beautiful shapes.
Watch it transform:
→ 4 coils
→ 20 coils
→ 50 coils
→ 100 coils
The equations:
x = (R + r·cos(nt))·cos(t)
y = (R + r·cos(nt))·sin(t)
z = r·sin(nt)
Simple math. Stunning geometry.
Checkout: https://dailymathvisuals.lemonsqueezy.com/
🔔 Subscribe for more visual mathematics
📱 Instagram:
🎵 TikTok:
patreon: https://www.patreon.com/c/dailymathvisuals
Click here to claim your Sponsored Listing.
Location
Category
Contact the school
Address
California City, CA