In this problem, I explain the NUMRANGE problem in InterviewBit.
I have used sliding window method to solve a complex problem in O(n) time.
Problem Satement:
Given an array of integers and a range, find the number of subarrays which has the sum in the range.
Example 1:
Input: [1,2,3,4] (5,10)
Output: 3
Explanation:
[2,3]
[3,4]
[2,3,4]
so the output is 3
Question:
https://www.interviewbit.com/problems/numrange/
Code in java:
https://github.com/prayagcbose/code/blob/main/NUMRANGE
Download
0 formats
No download links available.
Nums In Range | NUMRANGE | coding bose in Malayalam | NatokHD