niromru

Untitled

Nov 5th, 2021
778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. n = int(input()) - 1
  2. s = input()
  3. v = ['0']
  4. for i in range(n):
  5.     if s[i] == 'R':
  6.         v.append(str(i + 1))
  7.     else:
  8.         v.insert(0, str(i + 1))
  9. print(*v)
Advertisement
Add Comment
Please, Sign In to add comment