Welcome to CodingCraft!
We solve coding problems with clear, step-by-step explanations focused on logic and clean code.
Most solutions are in Python — perfect for interview prep or sharpening your skills.
Subscribe and start coding smarter!


CodingCraft

⚔️ New Video – Meta Puzzle “Boss Fight” (Level 3) ⚔️

In my earlier video, I shared a greedy solution for Boss Fight. It passed all of Meta’s official tests, but later I discovered cases where it could get stuck in a local maximum and miss the true optimal result.

Today’s video brings the correct solution ✅

I explain two different approaches:
Brute Force with Pruning → simpler and practical, but not worst-case safe
Li Chao Segment Tree → fully optimized O(N log C), always correct and passes all test cases

📺 Watch here: https://youtu.be/CJlhShLDGFo

📂 Full source code: github.com/CodingCraftChannel/meta-puzzles

👉 Let me know what you think, and don’t forget to like & subscribe for more clean coding explanations!

#CodingCraft #MetaPuzzle #Algorithm #Python #LiChaoTree

4 months ago | [YT] | 0

CodingCraft

🚀 New Series Alert: Monotonic Stack = O(n) where others fail


I’ve started a new video series that dives into one of the most powerful patterns in algorithmic problem-solving — the Monotonic Stack.

So far, we’ve covered:

📘 Daily Temperatures — turning a naive O(n²) into a sleek O(n): 🔗 https://youtu.be/tL4-1opjb5g

📘 Stock Span Problem — classic optimization in trading-style scenarios: 🔗 https://youtu.be/C2s7XeAZEmA

⚡️ Shorts: Next Smaller Element (NSE) — a blazing-fast O(n) trick for finding the next smaller value to the right: 🔗 youtube.com/shorts/SiomoI83jI...

📂 And yes — there's a dedicated playlist for the entire Monotonic Stack series: 🔗 www.youtube.com/playlist?list...

Coming up next: Remove K Digits, 132 Pattern, and the Skyline Problem – all powered by stacks that just make sense.

💡 Whether you're prepping for interviews or leveling up your coding skills, mastering this pattern is a must!

👉 Subscribe to @CodingCraftChannel and follow the series.

#CodingCraft #MonotonicStack #CodingInterview #Python #Algorithms #DataStructures #CleanCode

6 months ago (edited) | [YT] | 0

CodingCraft

🎉 Level 1: COMPLETE! 🎉

All Meta Puzzle – Level 1 challenges are now solved and published on CodingCraft!
Each video walks you through a clean, visual Python solution — perfect for interview prep or leveling up your algorithmic thinking.

🧠 Coming next: Full coverage of Level 2 puzzles — with more advanced tricks, optimizations, and edge case handling.

⚠️ As we head into Level 3 and beyond, expect a noticeable spike in difficulty. These puzzles often require deeper analysis, clever strategies, and can’t always be brute-forced like some Level 1–2 tasks.

🚀 Stay tuned as we tackle the tougher Meta puzzles step by step — clean, visual, and always beginner-friendly (even when the problems aren’t 😉).

📌 If you're not subscribed yet, now’s the time.

6 months ago | [YT] | 0