Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Kids Blocks
Puzzle: Kids Blocks
Author: @MNada
Published Difficulty: Medium
Algorithm X Complexity: A Perfect Exam Exercise
Overview
We were all little architects once, stacking blocks into wobbly towers, only to knock them down with giggles and start again. In those tiny moments, we built more than castles — we built wonder, creativity, and the joy of endless possibilities.
This puzzle is a wonderful opportunity to practice your Algorithm X skills. Although the matrix setup is not difficult, you will need a bit more than just the basics, especially to avoid timing out on the more challenging test cases. With proper optimization, all test cases and validators can be solved in no more than ~5% of the time limit (Python).
This puzzle is also a reminder that Algorithm X is not always the entire solution. Sometimes, Algorithm X is just a piece of the overall solution, even for a puzzle of fairly moderate difficulty.