The Hut Group Interview Question: Determine if a string contain... | Glassdoor

Interview Question

Software Engineer Industrial Placement Interview Manchester, England (UK)

Determine if a string containing all sorts of brackets is

  balanced (the sequence of brackets is closed correctly).
Answer

Interview Answer

1 Answer

0

I used a stack and a reference to the last open bracket. If at the end of the program, the stack would be empty, then the string is well balanced

Interview Candidate on Dec 12, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.