Write a function count Valid Strings() that takes a string, where each character in the string is
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function count Valid Strings() that takes a string, where each character in the string is a bracket, and returns the count of unique strings that are valid when minimum number of invalid parentheses are removed to make the invalid string valid. For example: countValidString("()())()") will return 2 because "(())()" and "()()()" are the two valid strings that can be formed by removing only one character from the given string. Please keep in mind that countValidStrings() will return 0 if already a valid string is passed as input.
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: