human
Maximum length substring having all same characters after k changes | function to find the maximum length of substring having character ch.
traverse the whole string.
if character is not same as ch increase count.
While count > k traverse the string again until count becomes less than k and decrease the count when characters are not same.
length of substring will be rightIndex - leftIndex + 1. Compare this with the maximum length and return maximum length.
function which returns maximum length of substring.
Driver Code"
Solution in Python:

=====
Write me a code to maximum length substring having all same characters after k changes and the other steps required?
assistant
#Here is code to maximum length substring having all same characters after k changes and the other steps required.
 def findLen ( A , n , k , ch ) :
	maxlen = 1
	cnt = 0
	l = 0
	r = 0
	while r < n :
		if A [ r ] != ch :
			cnt += 1
		while cnt > k :
			if A [ l ] != ch :
				cnt -= 1
			l += 1
		maxlen = max ( maxlen , r - l + 1 )
		r += 1
	return maxlen
def answer ( A , n , k ) :
	maxlen = 1
	for i in range ( 26 ) :
		maxlen = max ( maxlen , findLen ( A , n , k , chr ( i + ord ( ' A ' ) ) ) )
		maxlen = max ( maxlen , findLen ( A , n , k , chr ( i + ord ( ' a ' ) ) ) )
	return maxlen
if __name__ == " _ _ main _ _ " :
	n = 5
	k = 2
	A = " ABABA "
	print ( " Maximum ▁ length ▁ = " , answer ( A , n , k ) )
	n = 6
	k = 4
	B = " HHHHHH "
	print ( " Maximum ▁ length ▁ = " , answer ( B , n , k ) )