Find the String having each substring with exactly K distinct characters | Function to find the required output string ; Each element at index i is modulus of K ; Driver code ; initialise integers N and K
def findString ( N , K ) : NEW_LINE INDENT for i in range ( N ) : NEW_LINE INDENT print ( chr ( ord ( ' A ' ) + i % K ) , end = " " ) ; NEW_LINE DEDENT DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = 10 ; NEW_LINE K = 3 ; NEW_LINE findString ( N , K ) ; NEW_LINE DEDENT