Ikea
View as PDFIndra is shopping at Ikea. They find a row of tables, with
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 , followed by a string of length
. 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 , followed by a string of length
.
Output
For each table, output whether its price tag is to its left (L) or right (R).
Constraints
Example 1
Input
3
T##T#T
Output
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).
Comments