Ikea
Indra is shopping at Ikea. They find a row of n tables, with n price tags interspersed between them. However, a dilemma awaits! Indra cannot tell which price tag corresponds with which table. Therefore, for each table, output whether its price tag is to its left (L) or right (R).
The input consists of a single integer n, followed by a string of length 2n. The string consists of the characters '#' (price tag) or 'T' (table). It is guaranteed that there is a unique valid allocation of tables to adjacent price tags.
Input
A single integer n, followed by a string of length 2n.
Output
For each table, output whether its price tag is to its left (L) or right (R).
Constraints
- 1≤N≤105
Example 1
3
T##T#T
RLL
Explanation
The first table (index 0) corresponds to the price tag to its right (index 1). The other two tables correspond to the price tags to their left (index 3 to index 2, index 5 to index 4).
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.