Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ecd4813

Browse files
committed
Added README.md file for Two Out of Three
1 parent dc83689 commit ecd4813

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

‎2159-two-out-of-three/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<h2><a href="https://leetcode.com/problems/two-out-of-three">Two Out of Three</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr>Given three integer arrays <code>nums1</code>, <code>nums2</code>, and <code>nums3</code>, return <em>a <strong>distinct</strong> array containing all the values that are present in <strong>at least two</strong> out of the three arrays. You may return the values in <strong>any</strong> order</em>.
2+
<p>&nbsp;</p>
3+
<p><strong class="example">Example 1:</strong></p>
4+
5+
<pre>
6+
<strong>Input:</strong> nums1 = [1,1,3,2], nums2 = [2,3], nums3 = [3]
7+
<strong>Output:</strong> [3,2]
8+
<strong>Explanation:</strong> The values that are present in at least two arrays are:
9+
- 3, in all three arrays.
10+
- 2, in nums1 and nums2.
11+
</pre>
12+
13+
<p><strong class="example">Example 2:</strong></p>
14+
15+
<pre>
16+
<strong>Input:</strong> nums1 = [3,1], nums2 = [2,3], nums3 = [1,2]
17+
<strong>Output:</strong> [2,3,1]
18+
<strong>Explanation:</strong> The values that are present in at least two arrays are:
19+
- 2, in nums2 and nums3.
20+
- 3, in nums1 and nums2.
21+
- 1, in nums1 and nums3.
22+
</pre>
23+
24+
<p><strong class="example">Example 3:</strong></p>
25+
26+
<pre>
27+
<strong>Input:</strong> nums1 = [1,2,2], nums2 = [4,3,3], nums3 = [5]
28+
<strong>Output:</strong> []
29+
<strong>Explanation:</strong> No value is present in at least two arrays.
30+
</pre>
31+
32+
<p>&nbsp;</p>
33+
<p><strong>Constraints:</strong></p>
34+
35+
<ul>
36+
<li><code>1 &lt;= nums1.length, nums2.length, nums3.length &lt;= 100</code></li>
37+
<li><code>1 &lt;= nums1[i], nums2[j], nums3[k] &lt;= 100</code></li>
38+
</ul>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /