×

# Is Question Understanding Is Wrong Or Solution Of ZCO Matched Brackets 2?

 0 I am solving ZCO Matched Brackets 2. Question Link : ZCO12003 My Explanation To My Solution: First i am checking for Maximum Alternative Depth in the first for loop. I am checking it by taking the observation of brackets. If i encounter bracket ( after [ or bracket [ after ( then i increment my conter by 1 and storing the maximum ans to a variable. In second loop i am checking for the maximum number of brackets between ( ) (Inclusive) and maximum number of brackets between [ ] (Inclusive) and printing the answer. My Solution: My Code asked 31 Jan, 23:21 15●6 accept rate: 0%

 1 I looked at your code. I don't think there is any issue with queries of type 2 and 3. The issue is with computation of alternating depth. Instead of giving away the error to you and spoiling the fun, let's give you a test case for which your solution fails ;) View Content For this, your solution prints an alternating depth of 0. while the answer should be 2. Happy debugging :) If you still have any issues, feel free to ask them. answered 03 Feb, 13:35 875●2●14 accept rate: 10%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,070
×10
×3
×3