【题目】
Given a string S and a string T, count the number of distinct subsequences of T in S.
A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relati...
分类:
其他好文 时间:
2014-06-29 07:27:17
阅读次数:
210
http://unicode.org/reports/tr35/tr35-6.html#Date_Format_PatternsAppendix F:Date
Format PatternsA date pattern is a string of characters, where specifi...
分类:
其他好文 时间:
2014-06-11 23:37:19
阅读次数:
499
Implement an algorithm to print all valid (
properly opened and closed) combinations of n-pairs of parentheses.思路:比如 n = 3,
((())) 就是一个valid combinati...
分类:
其他好文 时间:
2014-06-11 13:19:00
阅读次数:
306
1.1Implement an algorithm to determine if a
string has all unique characters. What if you cannot use additional data
structures?字符串问题,需要先确定是不是只有ASCII码...
分类:
其他好文 时间:
2014-06-11 12:27:53
阅读次数:
247
成员变量buf是存储数据的缓冲区 count是缓冲区中的有效字节数。 /** * The
buffer where data is stored. */ protected byte buf[]; /** * The number of valid
byte...
分类:
编程语言 时间:
2014-06-11 11:03:44
阅读次数:
269
第一种方法,用栈实现,最容易想到,也比较容易实现,每次碰到‘)’时update
max_len,由于要保存之前的‘(’的index,所以spacecomplexity 是O(n) 1 // 使用栈,时间复杂度 O(n),空间复杂度 O(n)
2 class Solution { 3 publ...
分类:
其他好文 时间:
2014-06-11 09:16:10
阅读次数:
197
字符串和字符 (Strings and Characters)String是一个有序的字符集合,例如
"hello, world", "albatross"。Swift 字符串通过String类型来表示,也可以表示为Character类型值的集合。Swift
的String和Character类型提...
分类:
其他好文 时间:
2014-06-08 00:24:00
阅读次数:
381
Evaluate the value of an arithmetic expression
in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be
an integer or another ex...
分类:
其他好文 时间:
2014-06-07 20:34:41
阅读次数:
214
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.
The Sudoku board could be partially filled, where empty cells are filled with the character '.'.
A partially fille...
分类:
其他好文 时间:
2014-06-07 12:51:12
阅读次数:
225
原题地址:https://oj.leetcode.com/problems/valid-sudoku/题意:Determine
if a Sudoku is valid, according to:Sudoku Puzzles - The Rules.The Sudoku board
could b...
分类:
编程语言 时间:
2014-06-07 11:26:18
阅读次数:
296