You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2><ahref="https://leetcode.com/problems/number-of-common-factors">Number of Common Factors</a></h2> <imgsrc='https://img.shields.io/badge/Difficulty-Easy-brightgreen'alt='Difficulty: Easy' /><hr><p>Given two positive integers <code>a</code> and <code>b</code>, return <em>the number of <strong>common</strong> factors of </em><code>a</code><em> and </em><code>b</code>.</p>
2
+
3
+
<p>An integer <code>x</code> is a <strong>common factor</strong> of <code>a</code> and <code>b</code> if <code>x</code> divides both <code>a</code> and <code>b</code>.</p>
4
+
5
+
<p> </p>
6
+
<p><strongclass="example">Example 1:</strong></p>
7
+
8
+
<pre>
9
+
<strong>Input:</strong> a = 12, b = 6
10
+
<strong>Output:</strong> 4
11
+
<strong>Explanation:</strong> The common factors of 12 and 6 are 1, 2, 3, 6.
12
+
</pre>
13
+
14
+
<p><strongclass="example">Example 2:</strong></p>
15
+
16
+
<pre>
17
+
<strong>Input:</strong> a = 25, b = 30
18
+
<strong>Output:</strong> 2
19
+
<strong>Explanation:</strong> The common factors of 25 and 30 are 1, 5.
0 commit comments