Number of Common Factors
Return how many positive integers divide both a and b.
Example 1
a 12
b 6
returns 4
1, 2, 3 and 6 divide both.
Example 2
a 25
b 30
returns 2
1 and 5.
Constraints
1 <= a, b <= 1000
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More Math problems
- Power of FourBeginner
- Power of ThreeBeginner
- Power of TwoBeginner
- Product Minus Sum of DigitsBeginner
- Seconds to ClockBeginner
- Staircase of StonesBeginner
- Steps to Reduce to ZeroBeginner
- Sum of Consecutive PowersBeginner