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 thecorrect order with no matched opening and closing pairs.
- (empty) ""
- [] OK
- [][] OK
- [[]] OK
- [[[][]]] OK