Skip to content

Commit 52856f2

Browse files
refactor 1248
1 parent 619fc55 commit 52856f2

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

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

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,11 @@
11
package com.fishercoder.solutions;
22

3-
/**
4-
* 1248. Count Number of Nice Subarrays
5-
*
6-
* Given an array of integers nums and an integer k. A subarray is called nice if there are k odd numbers on it.
7-
*
8-
* Return the number of nice sub-arrays.
9-
*
10-
* Example 1:
11-
* Input: nums = [1,1,2,1,1], k = 3
12-
* Output: 2
13-
* Explanation: The only sub-arrays with 3 odd numbers are [1,1,2,1] and [1,2,1,1].
14-
*
15-
* Example 2:
16-
* Input: nums = [2,4,6], k = 1
17-
* Output: 0
18-
* Explanation: There is no odd numbers in the array.
19-
*
20-
* Example 3:
21-
* Input: nums = [2,2,2,1,2,2,1,2,2,2], k = 2
22-
* Output: 16
23-
*
24-
* Constraints:
25-
* 1 <= nums.length <= 50000
26-
* 1 <= nums[i] <= 10^5
27-
* 1 <= k <= nums.length
28-
* */
293
public class _1248 {
304
public static class Solution1 {
315
public int numberOfSubarrays(int[] nums, int k) {
326
for (int i = 0; i < nums.length; i++) {
337
for (int j = 0; j < nums.length; j++) {
34-
8+
//TODO: implement it
359
}
3610
}
3711
return -1;

0 commit comments

Comments
 (0)