Your expedition finally stands at the heart of the ancient temple. But as you study the inscriptions in the darkness, two wisps of green smoke burst forth. The walls begin to shake. The giant sandglass begins flowing with less than an hour before it empties, and a rumbling tells you that you don’t want to be around when that happens. Can you use math to escape the temple?

From TED Ed and educator Dennis E. Shasha, here’s a logic puzzle that comes in the form of a mysterious tale. But don’t just let the video play through to the solution! TED Ed gives you a moment to pause and give this brain exercise a try. Can you solve the temple riddle?

Related reading: Heuristics.

Try this next: The Matchstick Triangle Puzzle.