GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesBracket Lock

Gamified challenge · Stacks

Bracket Lock

The vault code is a string of brackets ( ) [ ] { } and dial digits 0-9. Digits don't matter. The vault opens only if every opening bracket is closed by the same kind of bracket, and brackets close in the reverse order they were opened.

Write balanced(code) that returns true if the vault opens, else false. A code with no brackets at all (even an empty one) opens.

Examples: {1(2[3]4)5} opens. ([)] doesn't: the ) arrives while [ is still open. ((( doesn't either: nothing closes.

Sign in to play Bracket Lock

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account