Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Syntax Checker Tom is facing a problem that he is using Notepad to code. And now, he wants to confirm that there are no errors

image text in transcribed
image text in transcribed
Syntax Checker Tom is facing a problem that he is using Notepad to code. And now, he wants to confirm that there are no errors in the usage of brackets in his code Your task is to help Tom to check if there is an error in the usage of brackets where opening brackets are and (, and the corresponding closing brackets are] and ). The code can contain any brackets from the set 1 00 Input The input contains multiple test cases. Each test case contains a string s in one line which consists of characters whose ASCII codes range from 32 to 126 (In other words, there will be blank space in S). It is guaranteed that the length of S is in the range from 1 to 100000. Output Print "Success" if all the brackets [0 0 0 are matched. Otherwise, print the position where the first unmatched closing bracket is found, and there are no unmatched closing bracket, print the position of the first unmatched opening bracket. if

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago