Use it when
Warm-up: digits of a number, running totals, simple loops and conditions. Do these if you're new to coding or to your language.
Key idea
Break the number or array into steps you can do by hand, then turn each step into a loop. Use n % 10 to get the last digit and n / 10 to drop it.
- Fizz BuzzEasy
- Running Sum of 1d ArrayEasy
- Richest Customer WealthEasy
- Number of Steps to Reduce a Number to ZeroEasy
- Count the Digits That Divide a NumberEasy
- Palindrome NumberEasy
- Plus OneEasy
- Reverse IntegerMedium
- Sum of DigitsEasy
- Prime or NotEasy
- GCD and LCMEasy