Build the logic. Then see the code.

12345 % 10 reads the last digit, 5. 12345 / 10 drops it, leaving 1234.

Every problem is taught pattern by pattern. You try it, get hints one at a time, see why brute force fails, trace an example by hand, and only then open the Java, C++ and Python solution.

Start with How to think

All areas

  1. How to think32 problems
  2. Arrays85 problems
  3. Binary search40 problems
  4. Strings26 problems
  5. Linked lists56 problems
  6. Recursion and backtracking34 problems
  7. Bit manipulation14 problems
  8. Stacks and queues47 problems
  9. Heaps and priority queues22 problems
  10. Greedy40 problems
  11. Trees47 problems
  12. Binary search trees26 problems
  13. Graphs67 problems
  14. Dynamic programming86 problems
  15. Tries10 problems
  16. Advanced structures0 problems
  17. Maths for DSA3 problems