摘要: Notes: 1. Use long since it will overflow. 2 When c != '*', it is normal decode ways. Thus current ways is c could be single digits (c > 0 ?) * prev o 阅读全文
posted @ 2017-09-04 16:36 keepshuatishuati 阅读(149) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ class Solution { public ListNode reverseKGr... 阅读全文
posted @ 2017-09-04 15:27 keepshuatishuati 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Note: The lower one can cross other higher recetangle. Thus height[j] <= height[left/ right -/+ 1] 阅读全文
posted @ 2017-09-04 15:18 keepshuatishuati 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Brute Force: has '*' before find last index of s and p when star found, s move forward char s not reaches end -- > p reaches end | no star NOT MATCH | 阅读全文
posted @ 2017-09-04 14:49 keepshuatishuati 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Note: 1. There is a trick here: As it only gets the starting point, we can check each bound of the building. Also we have to have a "sign" to know whe 阅读全文
posted @ 2017-09-04 14:04 keepshuatishuati 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Note: 1. When real index is 0. It will be only add as first element without any opeartors. 2. When the starting char of one layer is '0', it should br 阅读全文
posted @ 2017-09-04 13:41 keepshuatishuati 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Note: It could be other chars in the String. Do not count as invalid parenthesis. Second try: 1. Count j until i. not exceed i. 2. Return after remove 阅读全文
posted @ 2017-09-04 07:49 keepshuatishuati 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Note: 1. Scan from the small level. 2. Only take the index larger one if same digits. 阅读全文
posted @ 2017-09-04 07:20 keepshuatishuati 阅读(273) 评论(0) 推荐(0) 编辑