for test in range(int(input())):
z = [(x, len(list(x))) for x in itertools.groupby(l)]
print(max(z, key=lambda x:x)+1)
The question is chefsign which was asked in july long.The above code satisfies some while rest are not fulfilled. Can anyone help?
Your code will fail if all “=” in test case… like…
because n would be empty string in that case… otherwise your algo is correct…
Thanks a lot again:)