C # implementation to find smallest subarray with all occurrences of a most frequent element
using System ; using System . Collections . Generic ; class GfG { static void smallestSubsegment ( int [ ] a , int n ) {