05. Maths
🧠Maths Strategy
- Modular Arithmetic: \((a+b)\%m = ((a\%m) + (b\%m))\%m\). Always handle negative results:
(a%m + m)%m. - GCD: Use Euclidean Algorithm:
gcd(a, b) = gcd(b, a%b). - Primes: Use Sieve of Eratosthenes for finding primes up to \(N\).
- Permutations: Rank problems usually involve counting how many words start with smaller characters.
🟢 Ad-Hoc Logic & Puzzles
- Majority Element
- N By 3 Repeat Number
- Monkeys And Doors
- 100 People In A Circle
- Find Nth Magic Number
- Color Of The Last Ball
- Color Of The Last Ball II
- Ratio Of Boys And Girls
- Spiders Web
- Find If Two Rectangles Overlap
- Leap Year III
- Rearrange Array
🟡 Modular Arithmetic
- Excel Column Number
- Excel Column Title
- Implement Power Function
- A B And Modulo
- Mod String
- Divisibility By Eight
- Repeat And Missing Number Array
- Concatenate Three Numbers
- Least Common Multiple
- Prime Modulo Inverse
- Pair Sum Divisible By M
- Very Large Power
🟠GCD (Greatest Common Divisor)
- Greatest Common Divisor
- Delete One
- Enumerating GCD
- Pubg
- GCD CMPL
- Largest Coprime Divisor
- Divisor Game
- All GCD Pair