Skip to content

Commit 7d7fdf4

Browse files
committed
Create README - LeetHub
1 parent 9828bda commit 7d7fdf4

File tree

1 file changed

+32
-0
lines changed
  • 3242-count-elements-with-maximum-frequency

1 file changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<h2><a href="https://leetcode.com/problems/count-elements-with-maximum-frequency">3242. Count Elements With Maximum Frequency</a></h2><h3>Easy</h3><hr><p>You are given an array <code>nums</code> consisting of <strong>positive</strong> integers.</p>
2+
3+
<p>Return <em>the <strong>total frequencies</strong> of elements in</em><em> </em><code>nums</code>&nbsp;<em>such that those elements all have the <strong>maximum</strong> frequency</em>.</p>
4+
5+
<p>The <strong>frequency</strong> of an element is the number of occurrences of that element in the array.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre>
11+
<strong>Input:</strong> nums = [1,2,2,3,1,4]
12+
<strong>Output:</strong> 4
13+
<strong>Explanation:</strong> The elements 1 and 2 have a frequency of 2 which is the maximum frequency in the array.
14+
So the number of elements in the array with maximum frequency is 4.
15+
</pre>
16+
17+
<p><strong class="example">Example 2:</strong></p>
18+
19+
<pre>
20+
<strong>Input:</strong> nums = [1,2,3,4,5]
21+
<strong>Output:</strong> 5
22+
<strong>Explanation:</strong> All elements of the array have a frequency of 1 which is the maximum.
23+
So the number of elements in the array with maximum frequency is 5.
24+
</pre>
25+
26+
<p>&nbsp;</p>
27+
<p><strong>Constraints:</strong></p>
28+
29+
<ul>
30+
<li><code>1 &lt;= nums.length &lt;= 100</code></li>
31+
<li><code>1 &lt;= nums[i] &lt;= 100</code></li>
32+
</ul>

0 commit comments

Comments
 (0)