Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis0
write a Python program to split it into groups of perfectly matched parentheses without any whitespace
(---Without using function----) Input:Ā ( ()) ((()()())) (()) () Output: ['(())', '((()()()))', '(())', '()'] Input:Ā () (( ( )() ( )) ) ( ()) Output: ['()', '((()()()))', '(())']
2 Respostas
+ 1
Hint: stacks sre usually good for this. You could also use a left counter and a right counter
0
Please link your attempt