Checking string has balanced parentheses

后端 未结 18 2347
谎友^
谎友^ 2020-12-01 08:42

I am reading the Algorithm Design Manual Second Edition and this is from an exercise question. Quoting the question

A common problem for comp

18条回答
  •  渐次进展
    2020-12-01 09:00

    Why have a return value and an out parameter that give the same information?

    You could return an int: -1 = balanced, otherwise the index of the error.

提交回复
热议问题