ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1183. Brackets Sequence

Python3: memory recurcion accepted 0.15 [Hint]
Posted by KostyaRychkov 26 Jun 2020 19:51
Hint:
We must find pair for the first character or create it.
If S[0] is ']' or ')', then we must add '[' or '(' in begin.
If S[0] is '[' or '(', then we can find pair in S or add ']' or ')' after S[0].

Edited by author 26.06.2020 19:51