Function to count subarrays for each element where it is the minimum
static void minSubarray ( int [ ] arr , int N ) { int [ ] result = new int [ N ] ; Stack < pair > l = new Stack < > ( ) ; Stack < pair > r = new Stack < > ( ) ;