dush1729's blog

By dush1729, history, 5 years ago, In English

Problem: https://codingcompetitions.withgoogle.com/kickstart/round/000000000019ffc8/00000000002d83dc

We can solve above problem using stack. But we can use eval from python 2 library also to solve this question. Thanks to sonu628 for this idea. But unfortunately this solution gives Runtime Error(RE) for second test and Accepted for first test. Can we fix this?

Solution: https://ideone.com/dDwtoM

  • Vote: I like it
  • -21
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

got it accepted by adding

import sys
sys.setrecursionlimit(100000)