Given a list of N numbers(1-indexed), a continuous block is K-ordered block if it has more than K same elements occurring consecutively.
Example : [2,4,4,5,5,5,3,3] is having a 3-ordered block from index 4 to 6 and a 2-ordered block from 7 to 8. Block from 4 to 6 is 2-ordered block too.
Now if we are given Queries of form : LeftIndex,RightIndex,Order-K
We need to tell between LeftIndex and RightIndex how many Order-K blocks are present.
Say if query is of type 2,8,2 then answer is 3 as 3 blocks are with Order 2. They are from index 2 to 3,4 to 6,7 to 8.
How to solve this problem if queries are up to 100000, and list can be 100000.