Ikea
Problem Statement
Indra 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 to which table.
For each table, output whether its price tag is to its left (L) or right (R).
Input
The first line will contain a single integer .
The next line will contain a string of length . The string consists of the characters '#' (Pricetag) or 'T' (Table).
Output
One line, consisting of characters of either 'L' or 'R'.
Constraints
For all test cases, .
It is guaranteed that there is a unique valid allocation of tables to their adjacent price tags.
Sample Test Cases
Example 1
Input
3
T##T#T
Output
RLL
Explanation
The first table (index 0) corresponds to the pricetag to its right (index 1). The other two tables correspond to the pricetags to their left (index 3 to index 2, index 5 to index 4).
Python Template
n = int(input())
string = input()
Comments