Construct a string of length L such that each substring of length X has exactly Y distinct letters | Python implementation to construct a string of length L such that each substring of length X has exactly Y distinct letters . ; Initialize p equal to the ASCII value of a ; Iterate till the length of the string ; Driver code
def String ( l , x , y ) : NEW_LINE INDENT p = 97 NEW_LINE for j in range ( l ) : NEW_LINE INDENT ans = chr ( p + j % y ) NEW_LINE print ( ans , end = " " ) NEW_LINE DEDENT DEDENT l = 6 NEW_LINE x = 5 NEW_LINE y = 3 NEW_LINE String ( l , x , y ) NEW_LINE