摘要:
Solution 1: Solution with out using % 阅读全文
posted @ 2016-12-01 12:46
neverlandly
阅读(423)
评论(0)
推荐(0)
摘要:
Refer to: https://discuss.leetcode.com/topic/58334/a-couple-of-java-solutions-with-explanations/2 When to add 1 instead of minus 1, here is an example 阅读全文
posted @ 2016-12-01 12:31
neverlandly
阅读(366)
评论(0)
推荐(0)
摘要:
Analysis: Given a string s, find out all chars that are invalid (i.e., count < k). The longest substring must reside in one of the substrings divided 阅读全文
posted @ 2016-12-01 11:33
neverlandly
阅读(429)
评论(0)
推荐(0)
摘要:
F(0) = (0 * 4) + (1 * 3) + (2 * 2) + (3 * 6) = 0 + 3 + 4 + 18 = 25 [4, 3, 2, 6] F(1) = (0 * 6) + (1 * 4) + (2 * 3) + (3 * 2) = 0 + 4 + 6 + 6 = 16 [6, 阅读全文
posted @ 2016-12-01 08:12
neverlandly
阅读(226)
评论(0)
推荐(0)
摘要:
这道题题干给出了判断 one single UTF-8 char的方法,然后给一个UTF-8 char sequence,判断是不是正确sequence. (读题读了很久) 这道题关键是要学到用 & 取出一个bit sequence当中几位的方法 二进制数表示法:在前面加 0b, 八进制加0o, 十 阅读全文
posted @ 2016-12-01 07:09
neverlandly
阅读(733)
评论(0)
推荐(0)
摘要:
自己的做法:这种括号问题肯定是用栈,最好是先在栈里存一个空元素,然后stack.peek().append()各种操作 一个栈存string, 一个栈存number, 维护一个指针numStart指向数字的开始 1. 遇到数字啥也不做 2. 遇到char: stack.peek().append(c 阅读全文
posted @ 2016-12-01 05:07
neverlandly
阅读(474)
评论(0)
推荐(0)
摘要:
Refer to https://discuss.leetcode.com/topic/56052/really-easy-understanding-solution-o-n-java and https://discuss.leetcode.com/topic/55923/o-n-solutio 阅读全文
posted @ 2016-12-01 02:12
neverlandly
阅读(563)
评论(0)
推荐(0)
浙公网安备 33010602011771号