Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 452 Bytes

File metadata and controls

17 lines (14 loc) · 452 Bytes

Description

Given string of brackets, determine whether each sequence of brackets is balanced. If a string is balanced, return true; otherwise, return false.

  • A bracket is considered to be any one of the following characters: (, ), {, }, [, or ].

Sample

Input: "{([])}" Output: true
Input: "({}[])" Output: true
...
Input: "][" Output: false
Input: "{()" Output: false
Input: "{()()]" Output: false
Input: "{()([(}])}" Output: false
...