Java program to find the smallest element with frequency exactly k .
import java . util . * ; class GFG { public static int smallestKFreq ( int a [ ] , int n , int k ) { HashMap < Integer , Integer > m = new HashMap < Integer , Integer > ( ) ;