Skip to content

Instantly share code, notes, and snippets.

@Trepix
Trepix / README.md
Last active February 24, 2021 22:39
Balanced Brackets

Balanced Brackets

First step

Take an input string with X opening brackets [ and Y closing brackets ], in a random order.

Determine if the generated string of brackets is balanced, that is it consists of pairs of opening/closing brackets in the correct order with no matched opening and closing pairs.

Do not worry about input other than brackets and empty string.