Java implementation to find smallest subarray with all occurrences of a most frequent element
import java . io . * ; import java . util . * ; class GfG { static void smallestSubsegment ( int a [ ] , int n ) {