☆─────────────────────────────────────☆
mengt (一个人的狂欢) 于 (Sun Feb 3 02:19:25 2008) 提到:
发信人: ansonyy (ansonyy), 信区: JobHunting
标 题: 和大家再讨论一道面试算法题(MS)
发信站: BBS 未名空间站 (Sat Feb 2 09:36:25 2008)
A string is made of any combination of '{' '}' '[' ']' '(' ')'.
check if it is paired completely. For example:
"{[]()" false.
"{[]()}" true.
")))(((" false
"((()))" true
"{}([]())" true
"[(]){}" false
Use O(n) time and O(1) space (using stack is not the solution for this case).
希望大家在贴出自己的算法之前能够仔细验证一下,