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 challengesTile Rotate

Gamified challenge · Grid graphs

Tile Rotate

Water pours in from the left edge into the top-left tile and has to leave through the right edge of the bottom-right tile. Each tile is drawn at rotation 0: I opens up and down, L up and right, T left, up and right, + all four ways, and . is empty. Rotation k turns a tile k × 90° clockwise. Two neighbouring tiles connect only if both open toward each other.

Write rotations(grid) that returns a rotation from 0 to 3 for every tile, in a grid the same shape as grid, so the water gets through. For ["ILT", ".IL", "+LI"], turning the top-left I once makes it lie on its side, ready to take the water in: [[1, 2, 0], [0, 0, 0], [0, 0, 1]] works.

Sign in to play Tile Rotate

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