Description: Given a string, find the first character in the string that occurs at least k consecutive times.
Enter:
Output: If there is a character that appears at least k times in a row, output the character; otherwise, output No.
k=int(input()) #Number 4s = list(input()) #The string is converted to a list adfdfdfddfdfdfdffddddf = s[0] # first letter valuecounts = 0 #count the number of consecutive occurrencesfor i in range(0,len(s)): # Traverse the stringif f == s[i]:counts += 1else:f=s[i+1]counts = 0if counts>=k:print("Number:",counts,s[i])breakif counts