Skip to main content

Questions tagged [balanced-delimiters]

When delimiters (a character or sequence marking the beginning, end, or boundary of a unit of data) are correctly placed (often in pairs) within a sequence or sequences of data.

10 votes
5 answers
2k views

Objective: Given a string s containing '(', ')', '{', '}', '[', ']' (and other characters), determine if the input string is valid. An input string is valid if: ...
Madagascar's user avatar
  • 10.1k
30 votes
6 answers
72k views

I'm solving HackerRank "Stacks: Balanced Brackets" in Python. A bracket is considered to be any one of the following characters: (, ...
justapilgrim's user avatar
2 votes
3 answers
1k views

Problem: Stacks can be used to check whether the given expression has balanced symbols. This algorithm is very useful in compilers. Each time the parser reads one character at a time. If the character ...
Sol's user avatar
  • 29
10 votes
1 answer
3k views

Rules: You should create a function that receives a string with brackets, parentheses, or curly brackets, an example: test('{A}') The function must check that the ...
josmanuel's user avatar
  • 203
5 votes
2 answers
5k views

The code works, at least against the unit tests. But I would like input on how to refactor it. Or also maybe a way to do this without using temporary lists? I also have some special checks, like if ...
aldo's user avatar
  • 63
28 votes
6 answers
28k views

I have refactored one of my old homework assignments (mainly to utilize std::stack and some C++11), and I'm still having trouble making it less repetitive. It ...
Jamal's user avatar
  • 35.2k
3 votes
2 answers
940 views

I have used Stacks to check for brackets mismatch. (Parentheses matching problem using Stack algorithm) Any suggestions on how to improve the code? I have tried various examples and it works ...
Archer's user avatar
  • 315
9 votes
2 answers
5k views

Here is a small program for checking if the parentheses are balanced or not. I am new to the standard library, and this is my first program. How can I improve it? Any kind of modifications or ...
dsaharia's user avatar
  • 291
3 votes
2 answers
238 views

I don't have a formal description for this problem, but here are the parameters: Given a string S check that each opening bracket has a matching closing bracket. ...
T145's user avatar
  • 3,159
22 votes
7 answers
33k views

I was given an assignment to check for balanced parentheses from an arbitrary string where parentheses are defined as (, [ or { and their respective "closing" ...
Overly Excessive's user avatar
5 votes
2 answers
971 views

I am solving interview questions from InterviewBit site. Problem : Write a program to validate if the input string has redundant braces Return 0/1 : ...
Latika Agarwal's user avatar
2 votes
2 answers
4k views

I would like to receive feedback on my coding interview for the following problem: Bracket Match A string of brackets is considered correctly matched if every opening bracket in the string ...
NinjaG's user avatar
  • 2,599
9 votes
4 answers
4k views

A recent assignment asks me to create a program that checks for parentheses balance in a given string. As I can't find any duplicate questions that have code written in C, I decided to post another ...
54D's user avatar
  • 257
7 votes
5 answers
8k views

I've done a test for a job (which I failed) and I'd like to know in which ways my code could've been better. Here are the questions and my answers, it's not very long. 1) Make a program that checks ...
Aramil Rey's user avatar
44 votes
2 answers
40k views

Given an expression string exp, write a program to examine whether the pairs and the orders of "{","}","(",")","[","]" are correct in exp. For example,...
konijn's user avatar
  • 34.4k

15 30 50 per page
1
2 3 4 5 6