VG
Size: a a a
VG
VG
SG
Implement function check(str, bracketsConfig), that for given brackets sequence will return true if it is correct and false otherwise
In the second param there is bracketsConfig - the array of pairs open-closed brackets. Each subarray includes only 2 elements - opening and closing bracket
check('()', [['(', ')']]) // -> true
check('((()))()', [['(', ')']]) // -> true
check('())(', [['(', ')']]) // -> false
check('([{}])', [['(', ')'], ['[', ']'], ['{', '}']]) // -> true
check('[(])', [['(', ')'], ['[', ']']]) // -> false
check('[]()', [['(', ')'], ['[', ']']]) // -> true
check('[]()(', [['(', ')'], ['[', ']']]) // -> false
// special case: opening and closing bracket can be the same :)
check('||', [['|', '|']]) // -> true
check('|()|', [['(', ')'], ['|', '|']]) // -> true
check('|(|)', [['(', ')'], ['|', '|']]) // -> false
check('|()|(||)||', [['(', ')'], ['|', '|']]) // -> true
YM
VG
SG
VG
VG
check('()', [['(', ')']]) // -> true
вполне
парные жеYM
SG
SG
YM
YM
YM
YM
YM
YM
SG
YM