given a string,which is filled with either "(" or ")", for example "(())()())", write a function to check if the string is "proper". A "proper" string means if there is a "(" in the string, there should be a ")" which corresponds to the "(" in the string. For example, "))()("
Utilisateur anonyme
you can traverse through the string in a loop and increment a counter on occurrence of '(' and decrement on occurrence of ')' .Return false if counter becomes negative anytime in the loop.