All submissions for this problem are available.
A father can have 0,1,or 2 sons. Suppose the input is ABC B-D , it means A has two sons B and C and in turn B has one son D. They are invited at a party. They sit acc. to their ages as eldest first then the sons of eldest and then the sons of second person sitting and so on. If a person has no sons then we leave the spaces . In the above example, the sequence of their sitting is ABC-D. It means that B has only one son and in the output we have to find the place where A would be sitting.
HB- BA- ADE
XW- WJB BCA
D-G G-H H-C C-A A-X X-Z
X-Z A-X C-A H-C G-H D-G
Input: etc. Output: etc.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.