Skip to content

01. Basics

🧠 Problem Solving Strategy

  1. Square Root Rule: For prime checks or finding factors, you only need to iterate up to \(\sqrt{N}\).
  2. Modulo Operator: Use % to extract digits (e.g., n % 10 gets the last digit) or check divisibility.
  3. Edge Cases: Always check for 0, 1, and negative numbers.

🟢 Number Theory Logic

🟡 Loops & Simulation