Problem
Given an array arr containing only the values -1 and 1, and an integer k, determine whether there exists a subarray of length at least k whose elements sum to a value strictly greater than 0.
Input / Output
arr (each element is -1 or 1), integer k.true if such a subarray exists, otherwise false.Constraints
1 <= arr.length <= 10^51 <= k <= arr.lengtharr[i] is either -1 or 1.Example
arr = [-1, 1, 1, -1], k = 2 → true (subarray [1, 1] has length 2 and sum 2 > 0).arr = [-1, -1, -1, 1], k = 2 → false (no subarray of length >= 2 sums above 0).