The Land of Mines (MEDIUM)
Practice
3.4 (5 votes)
Medium
Problem
34% Success 560 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

As our mighty hero Sin is in pursuit of the wicked wizard,what he faces ahead is the land of mines .
In order to cross the land of mines Sin needs to disarm all the mines in his path.Individual mine contained an array of integers and a separate individual integer k written on it and a space above which "key" is written.
In order to diffuse a mine Sin needs to find key.The key to diffuse the bomb resides in the array written on individual mines.
To diffuse a mine Sin needs to find the count of all the sub arrays which contains k or more than k similar elements.
Since Sin is weak at calculations help Sin calculate the key in order to diffuse individual mine.

Contraints
1<=t<=1000
1<=n<=105
1<=ai<=109
1<=k<=105


Input
First line contains integer t denoting number of testcases , Next t testcases contains :
FIrst line contains integer n (size of array ) and k
Second line contains array of integers.

Output
for every testcase , output no. of subarrays.

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
183 votes
Tags:
AlgorithmsApprovedDynamic ProgrammingMediumOpen
Points:30
1 votes
Tags:
Max subarray sumIntroduction to Dynamic Programming 1Dynamic ProgrammingAlgorithms
Points:30
24 votes
Tags:
ApprovedMathMediumOpen
Editorial

No editorial available for this problem.