FreightPOP interview question

Valid Parenthesis, String ransomed note from available letters