-
Notifications
You must be signed in to change notification settings - Fork 161
/
find-common-characters.md
33 lines (24 loc) · 1.21 KB
/
find-common-characters.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<p>Given an array <code>A</code> of strings made only from lowercase letters, return a list of all characters that show up in all strings within the list <strong>(including duplicates)</strong>. For example, if a character occurs 3 times in all strings but not 4 times, you need to include that character three times in the final answer.</p>
<p>You may return the answer in any order.</p>
<p> </p>
<div>
<p><strong>Example 1:</strong></p>
<pre>
<strong>Input: </strong><span id="example-input-1-1">["bella","label","roller"]</span>
<strong>Output: </strong><span id="example-output-1">["e","l","l"]</span>
</pre>
<div>
<p><strong>Example 2:</strong></p>
<pre>
<strong>Input: </strong><span id="example-input-2-1">["cool","lock","cook"]</span>
<strong>Output: </strong><span id="example-output-2">["c","o"]</span>
</pre>
<p> </p>
<p><strong><span>Note:</span></strong></p>
<ol>
<li><code>1 <= A.length <= 100</code></li>
<li><code>1 <= A[i].length <= 100</code></li>
<li><code>A[i][j]</code> is a lowercase letter</li>
</ol>
</div>
</div>