Skip to content

Commit bf3c707

Browse files
refactor 697
1 parent a087a55 commit bf3c707

File tree

1 file changed

+0
-25
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-25
lines changed

src/main/java/com/fishercoder/solutions/_697.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,6 @@
66
import java.util.List;
77
import java.util.Map;
88

9-
/**
10-
* 697. Degree of an Array
11-
*
12-
* Given a non-empty array of non-negative integers nums,
13-
* the degree of this array is defined as the maximum frequency of any one of its elements.
14-
* Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums.
15-
16-
Example 1:
17-
18-
Input: [1, 2, 2, 3, 1]
19-
Output: 2
20-
Explanation:
21-
The input array has a degree of 2 because both elements 1 and 2 appear twice.
22-
Of the subarrays that have the same degree:
23-
[1, 2, 2, 3, 1], [1, 2, 2, 3], [2, 2, 3, 1], [1, 2, 2], [2, 2, 3], [2, 2]
24-
The shortest length is 2. So return 2.
25-
26-
Example 2:
27-
Input: [1,2,2,3,1,4,2]
28-
Output: 6
29-
30-
Note:
31-
nums.length will be between 1 and 50,000.
32-
nums[i] will be an integer between 0 and 49,999.
33-
*/
349
public class _697 {
3510
public static class Solution1 {
3611
public int findShortestSubArray(int[] nums) {

0 commit comments

Comments
 (0)