直接求逆序对就行了...时间复杂度O(nlogn)-------------------------------------------------------------------------#includeusing namespace std;#define idx(c) ((c) - 'A...
分类:
其他好文 时间:
2015-08-09 15:33:07
阅读次数:
175
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-08-09 00:17:57
阅读次数:
86
题目Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit string “23”...
分类:
其他好文 时间:
2015-08-07 22:23:27
阅读次数:
195
Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjac...
分类:
其他好文 时间:
2015-08-06 12:35:05
阅读次数:
118
【079-Word Search(单词搜索)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell,...
分类:
编程语言 时间:
2015-08-03 07:49:37
阅读次数:
131
Implement a trie with insert, search,
and startsWith methods.
Note:
You may assume that all inputs are consist of lowercase letters a-z.
基本思路,
作一个26叉树。
本来想作一个27叉,用额外一叉,表示字符串的结束字符('\0'). 但...
分类:
其他好文 时间:
2015-08-02 20:06:06
阅读次数:
138
July 6, 2015Problem statement:Word SearchGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of ...
分类:
其他好文 时间:
2015-08-02 14:55:34
阅读次数:
103
>>> import string>>> string.ascii_letters'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'>>> string.ascii_lowercase'abcdefghijklmnopqrstuvwxyz'>...
分类:
其他好文 时间:
2015-07-31 14:29:07
阅读次数:
117
DayPsLogRunningAgencyUVAEstateFRI1411h8p4pSAT1411h8p5094pSUN311h2p本周计划:Ps today: 141. 编程基础: uvaoj: 5092. letters: 8p , 2 letters each day. = 16p2. 房产评...
分类:
其他好文 时间:
2015-07-30 21:04:39
阅读次数:
113
Problem Definition:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just l...
分类:
其他好文 时间:
2015-07-30 16:24:09
阅读次数:
151