SolarWinds Interview Question

Find valid parenthesis pairs in a string with alphabets and brackets.