0

balanced parenthesis

I am trying to make the program called"balanced parenthesis". This is the basic application of stack. However, I got stuck and could not get it done. I understand the logic of this problem but I cannot put it into the code. https://code.sololearn.com/cNU8yLka03Y9/#py

15th Apr 2019, 4:21 PM
Khai123
Khai123 - avatar
37 Antworten
0
i did it but forgot to save it. i will write it here: string=“(((hello)))” def ch(string): for i in string: if i in “[{(“: print(“o”,end=“”) if i in “)]}: print(“c”,end=“”) else: print(“.”,end=“”) ch(string)
15th Apr 2019, 6:33 PM
Khai123
Khai123 - avatar
0
sr iam wrong
15th Apr 2019, 7:03 PM
Khai123
Khai123 - avatar
0
https://code.sololearn.com/cNU8yLka03Y9/?ref=app here bro. Just check it. THanks:)))
15th Apr 2019, 8:24 PM
Khai123
Khai123 - avatar
0
I don't want to use you, bro. In my middle school in VN, In time I was in 8th grade, I was struggled with math. I had a friend to teach me,bro. He was just like you,bro. He made me understand the problem by subdividing it into smaller probs. He sometimes blamed me because I was dumb; however, I was not sad. He was so motivated. therefore, I got higher grade on math tests in 9th grade and did math better in high school. That's the value of cooperating. By the way, what school are you in and how old are you?
17th Apr 2019, 6:37 PM
Khai123
Khai123 - avatar
0
I can post answers on this app and if you see my questions, just answer them. Or if you don't want to answer, just ignore them. I really want to study in group,bro:))
17th Apr 2019, 6:40 PM
Khai123
Khai123 - avatar
0
hey bro. I am doing the assignment called next greater element. At first, I thought I got it right. But it turned out that I got it wrong. I know the logic, but I could not compile it correctly
18th Apr 2019, 1:16 AM
Khai123
Khai123 - avatar
0
I already printed out the NGE . But my code was wrong. I will show you my codr
18th Apr 2019, 1:17 AM
Khai123
Khai123 - avatar
0
You can arrange the lines of your code first for more readability. Otherwise, it is incompréhensible.
4th May 2021, 1:55 PM
CHUN
- 1
yeh i will do it
15th Apr 2019, 6:06 PM
Khai123
Khai123 - avatar
- 1
after i do it, can you show me more step
15th Apr 2019, 6:06 PM
Khai123
Khai123 - avatar
- 1
so I got it wrong,right?
15th Apr 2019, 6:43 PM
Khai123
Khai123 - avatar
- 1
oh the if statement gives me the same output
15th Apr 2019, 6:56 PM
Khai123
Khai123 - avatar
- 1
thanks bro
15th Apr 2019, 7:14 PM
Khai123
Khai123 - avatar
- 1
i will do it tonigjt iam busy now
15th Apr 2019, 7:15 PM
Khai123
Khai123 - avatar
- 1
here bro
15th Apr 2019, 8:24 PM
Khai123
Khai123 - avatar
- 1
thanks bro
15th Apr 2019, 9:09 PM
Khai123
Khai123 - avatar
- 1
i will do it when i get home
15th Apr 2019, 9:09 PM
Khai123
Khai123 - avatar
- 1
hey,bro
16th Apr 2019, 1:45 AM
Khai123
Khai123 - avatar
- 1
i will do it this morning
16th Apr 2019, 12:11 PM
Khai123
Khai123 - avatar
- 1
I'am about to finish it
16th Apr 2019, 3:38 PM
Khai123
Khai123 - avatar