Tap here to switch tabs
Problem
Submissions

Problem: Number of Common Factors

med
30 min
Try to solve the Number of Common Factors problem.

Statement

Given two positive integers a and b, return the total number of common factors of a and b.

An integer xx is defined as a common factor of a and b if xx evenly divides both a and b.

Constraints:

  • 1≤1 \leq a, b ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Number of Common Factors

med
30 min
Try to solve the Number of Common Factors problem.

Statement

Given two positive integers a and b, return the total number of common factors of a and b.

An integer xx is defined as a common factor of a and b if xx evenly divides both a and b.

Constraints:

  • 1≤1 \leq a, b ≤1000\leq 1000