DDSA Solutions

Math

163 problems · 107 with full explanations

33 Easy59 Medium10 Hard
Math problems test number theory, combinatorics, and modular arithmetic. Common tools: GCD/LCM (Euclidean algorithm), prime sieve, modular inverse (Fermat's little theorem), digit manipulation, and bit tricks. Overflow is a key concern in C# — use long when products may exceed 2³¹.

How to practice

To practice Math problems effectively, start with the Easy problems listed below, trace through each solution on paper, then re-implement without looking. When you can recognise the math pattern within 30 seconds of reading a new problem, move on to Medium difficulty. Use the related topic pages and our study guide for a structured progression.

Open the full study guide →

Start here (Easy + explained)

All Math problems