Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo ...
分类:
其他好文 时间:
2016-04-11 07:10:54
阅读次数:
133
计算最长的无重复字符的串长 用HashMap记住重复的单词及其位置。当重复时,让tempStart指针移到重复位置+1,如果start指针小于tempStart,则更新start指针,长度就是当前重复的位置 - start。读到字符串末尾时还需要判断一次 ...
分类:
其他好文 时间:
2016-04-10 12:54:35
阅读次数:
112
因为要算匹配长度,所以要记录起始的位置。思路上要分三种情况吧,一种是完全匹配,一种是未匹配的是‘)’,一种是未匹配的是‘(’。如果发现没有左括号可以和右括号匹配,那么只要把右括号位置设置为start,重新开始新一轮的寻找就可以了;如果没有右括号可以和左括号匹配,则要用当前位置减去堆栈栈顶的左括号位置 ...
分类:
其他好文 时间:
2016-04-10 12:42:46
阅读次数:
216
这题不能使用递归来写,因为有一个输入长度是17173,会爆栈。因此得手动模拟栈调用。 ...
分类:
其他好文 时间:
2016-04-10 01:01:45
阅读次数:
110
104. Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from th ...
分类:
其他好文 时间:
2016-04-09 12:19:07
阅读次数:
160
3. Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, ...
分类:
其他好文 时间:
2016-04-09 12:15:03
阅读次数:
110
arm 指令的基本格式如下: <opcode>{<cond>}{S}{.W\.N} <Rd>,<Rn>{,<operand2>} opcode:指令助记符,如MOV,ADD等 cond:执行条件 S:指定指令是否影响CPSR寄存器的值,如ADDS,SUBS等 .W\.N:指令宽度说明符,.W为32位 ...
分类:
其他好文 时间:
2016-04-06 23:32:01
阅读次数:
238
1. longest-consecutive-sequence Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given[1 ...
分类:
编程语言 时间:
2016-04-06 14:44:43
阅读次数:
178