Java program to Check if a given array contains duplicate elements within k distance from each other
import java . util . * ; class Main { static boolean checkDuplicatesWithinK ( int arr [ ] , int k ) {