Driver code
public static void main ( String [ ] args ) { String str = " acdeac " ; int K = 4 ; if ( isKAlternating ( str , K ) ) System . out . print ( " Yes " + "NEW_LINE"); else System . out . print ( " No " + "NEW_LINE"); } }