这三道题是大摩实习现场面试时候的笔试题。
Valid Parentheses:
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are
all valid but "(]" and "([)]" are
not.
比较简单的栈操作,但是居然还是发现有问题。一个是switch语句不会写 - -, 二个是又是拉掉一些小细节,比如匹配了之后应当出栈,又忘了,最后要判断为空也忘了,哎,算起来100分的话也就能得30分了。。。。。
cl......
阅读全文