Developer or Tester
All submissions for this problem are available.
It is high time now, IT companies are hiring in huge numbers.
Now that they have hired they need to form teams each containing exactly 2 members.
No two members in the team have the same age.
In any team, older is given the position of a Developer (D) and younger is given the position of a Tester (T).
They have sorted all the members to form a list according to their ages (such that youngest in the list is the first).
However even before forming teams they have assigned designations (D or T) to all the members in the list.
Now it is your duty to tell whether it is still possible to form teams with the requirements stated above and
also maintain the assigned designation of each of the persons.
1st line: An Integer T denoting the number of test cases
Each test Case Contains:
A single line representing the list consists of only 'T '& / or 'D'
T lines each containing 'YES' (if possible to form group) or 'NO' (if not possible).
Input: Input 2 TTDD DDDDDD Output: YES NO CONSTRAINTS 1 <= T <= 20 1 <= length(list) <= 1,00,000
|Time Limit:||0.71 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, D, PERL, FORT, ADA, ASM, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, SCM guile, TCL, CLOJ, FS|
Fetching successful submissions