Valid number of pairs of bracket
Permutation of string