Driver code
public static void main ( String args [ ] ) { String str1 = " fodr " ; String str2 = " gork " ; int k = 2 ; if ( areKAnagrams ( str1 , str2 , k ) == true ) System . out . println ( " Yes " ) ; else System . out . println ( " No " ) ; } }