diff --git a/src/main/java/com/cool/ling_cha_mount/sliding_windows/Num1343.java b/src/main/java/com/cool/ling_cha_mount/sliding_windows/Num1343.java new file mode 100644 index 0000000..dc77982 --- /dev/null +++ b/src/main/java/com/cool/ling_cha_mount/sliding_windows/Num1343.java @@ -0,0 +1,33 @@ +package com.cool.ling_cha_mount.sliding_windows; + +/** + * Created with IntelliJ IDEA. + * + * @Author: Cool + * @Date: 2024/10/04/17:28 + * @Description: 1343. 大小为 K 且平均值大于等于阈值的子数组数目 + * DayNumber 1 + * Hard 2 + * Level 3 + * Score 1317 + */ +public class Num1343 { + public int numOfSubarrays(int[] arr, int k, int threshold) { + int res=0; + int sum=0; + for(int i=0;i=k*threshold){ + res++; + } + for(int i=k;i=k*threshold){ + res++; + } + } + return res; + } +}