摘要: 第一种方法,用栈实现,最容易想到,也比较容易实现,每次碰到‘)’时update max_len,由于要保存之前的‘(’的index,所以spacecomplexity 是O(n) 1 // 使用栈,时间复杂度 O(n),空间复杂度 O(n) 2 class Solution { 3 publ... 阅读全文
posted @ 2014-06-06 17:13 穆穆兔兔 阅读(446) 评论(0) 推荐(0)