Rolling in the Deep
All submissions for this problem are available.
"I heard that you're settled down That you found a girl and you're married now. I heard that your dreams came true. Guess she gave you things I didn't give to you."
Adele just got news about her old lover. She is in her study, reminiscing all the memories they shared and feeling lonely.
After some initial sobbing, she decided to send him a secret message. But she has a peculiar habit of enclosing all the messages in a series of parenthesis.
Now, Adele's husband gets hold of this message and finds out about the affair. He also knows that, only the message enclosed in the highest number of parenthesis is intended for her lover, all other parts are just a build-up because Adele likes Rolling in the Deep!.
He knows that Adele loves uniformity and thus the message will be balanced.Also She has written just one intended message for her lover. He needs your help to find out the message Adele is sending to her lover.
- A single line containing a string S, denoting the message Adele is sending to her lover.
- A single line containing the intended message.
Subtask #1 (40 points)
- 1 ≤ |S| ≤ 100
Subtask #2 (60 points)
- 1 ≤ |S| ≤ 100000
Input: ((Never mind(I'll find(someone like you)))) Output: someone like you
The message "someone like you" is enclosed inside 4 braces, which is the highest, and thus is the intended message Adele wants to send.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, 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, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions