04 2019 档案

[Leetcode] Rotate Image
摘要:思考方式是是這樣,如果有個3x3的二維陣列 1 2 3 4 5 6 7 8 9 以1到9以對線為中心交換,變成 1 4 7 2 5 6 3 8 9 在以5為中心交換 1 4 7 2 5 8 3 6 9 在轉換column的位置 7 4 1 8 5 2 9 6 3 就完成轉置了 因為c#這題的參數是 阅读全文

posted @ 2019-04-14 05:39 seako 阅读(99) 评论(0) 推荐(0)

[Leetcode] Longest Valid Parentheses
摘要:找出字串裡最長的合法括號組 簡單說,一樣stack搜尋合法parenth,把不合法的 ( & ) index 紀錄下來,最後算index間的差值取最大就是最長的 阅读全文

posted @ 2019-04-09 00:55 seako 阅读(109) 评论(0) 推荐(0)

[Leetcode] Valid Parentheses
摘要:字串是不是由合法的括號組組成 阅读全文

posted @ 2019-04-08 23:33 seako 阅读(129) 评论(0) 推荐(0)