Skip to content

Math & Geometry

These problems are less about a data structure and more about careful reasoning on numbers and matrices: moving things in place, spotting repeating cycles and avoiding overflow. They reward drawing small examples by hand.

After this topic: You can manipulate matrices in place, use fast exponentiation, and detect cycles in numeric sequences.

Do these first: 2-D Dynamic Programming, Bit Manipulation

0 of 8 solved0%

Step 1 · Read the lesson

Bit Manipulation & Math

XOR tricks, bit counting, in-place matrix moves, fast exponentiation and digit-by-digit arithmetic.

Step 2 · Solve the problems in order

Try each one for about 20 minutes first. Problems with a Run code tab are checked right here. If you are stuck, open Nudge, think again, then Idea. Go skeleton only gives the function shape, and Reference solution is for comparing after you have tried. Tick the box when you could solve it again without help.

  1. 1.Rotate ImageMedium
  2. 2.Spiral MatrixMedium
  3. 3.Set Matrix ZeroesMedium
  4. 4.Happy NumberEasy
  5. 5.Plus OneEasy
  6. 6.Pow(x, n)Medium
  7. 7.Multiply StringsMedium
  8. 8.Detect SquaresMedium