Domanda di colloquio di LinkedIn

Valid parentheses with other characters, e.g. (()e45)

Risposta di colloquio

Anonimo

22 dic 2018

Traverse the string, use a basic count with "(" => +1 , ")" =>-1 , skipping any other characters. If the count is ever < 0 or the ending count != 0 then it's not valid.