27 lines
495 B
Python
27 lines
495 B
Python
|
def solve():
|
||
|
n = int(input())
|
||
|
env = input()
|
||
|
|
||
|
winners_ct = [1]
|
||
|
t = env[0]
|
||
|
ind, k = 1, 1
|
||
|
for i in range(1, len(env)):
|
||
|
new = env[i]
|
||
|
if new == t:
|
||
|
k += 1
|
||
|
winners_ct.append(winners_ct[-1])
|
||
|
else:
|
||
|
winners_ct.append(winners_ct[-1]+k)
|
||
|
k = 1
|
||
|
t = new
|
||
|
return " ".join([str(a) for a in winners_ct])
|
||
|
|
||
|
|
||
|
def main():
|
||
|
count = int(input())
|
||
|
|
||
|
for _ in range(count):
|
||
|
print(solve())
|
||
|
|
||
|
|
||
|
main()
|