Skip to content

Commit 651b349

Browse files
committed
Added README.md file for Number of Common Factors
1 parent 05bfe08 commit 651b349

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<h2><a href="https://leetcode.com/problems/number-of-common-factors">Number of Common Factors</a></h2> <img src='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>&nbsp;</p>
6+
<p><strong class="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><strong class="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.
20+
</pre>
21+
22+
<p>&nbsp;</p>
23+
<p><strong>Constraints:</strong></p>
24+
25+
<ul>
26+
<li><code>1 &lt;= a, b &lt;= 1000</code></li>
27+
</ul>

0 commit comments

Comments
 (0)