Please read the new rule regarding the restriction on the use of AI tools. ×

Counting Subarrays!

Revision en2, by nHimanshu, 2023-05-16 20:44:56

Problem Description

Given an array A of N length and you are also given number B.

You need to find the number of subarrays in A having sum less than B. We may assume that there is no overflow.

Problem Constraints 1 <= N <= 100000 -100 <= A[i] <= 100 0 <= B <= 10000

Example: INPUT:: A----> [1,−2,4,8] k=0 OUTPUT:: 2

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English nHimanshu 2023-05-16 20:49:42 45
en2 English nHimanshu 2023-05-16 20:44:56 2 Tiny change: '] <= 100\n1 <= B <= 1' -> '] <= 100\n0 <= B <= 1'
en1 English nHimanshu 2023-05-16 20:43:10 358 Initial revision (published)