Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = int(input())
- for i in range(t):
- s = input()
- y = len(s)
- for j in range(len(s)):
- if s[y-j-3:y-j] == 'one' and s[y-j-5:y-j-2] == 'two':
- s = s[:y-j-3] + 'x' + s[y-j-2:]
- elif s[y-j-3:y-j] == 'one' or s[y-j-3:y-j] == 'two':
- s = s[:y-j-2] + 'x' + s[y-j-1:]
- print(s.count('x'))
- A = []
- for j in range(len(s)):
- if s[j] == 'x':
- A.append(j+1)
- print(' '.join(map(str, A)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement