Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Exampl ...
分类:
其他好文 时间:
2019-06-03 23:48:55
阅读次数:
107
lc316 Remove Duplicate Letters 我们用一个栈来保存最终的返回结果, 现在来看看什么时候能删除一个元素,bcabc走到a的时候发现c大于a而且a后还有c,所以可以删除 由此可见,当array[i]之前的字母较大,且在i之后还有重复的字母,就能删除 如何实现这个逻辑呢? 1 ...
分类:
其他好文 时间:
2019-06-03 12:55:14
阅读次数:
80
1、列表是什么 列表是由一系列按特定顺序排列的元素组成。 鉴于列表通常包含多个元素,给列表制定一个表示复数的名称(如letters,digits或names)是个不错的主意。 在Python中,用方括号([ ])来表示列表,并用逗号来分割其中元素。 1.访问列表元素 列表是有序集合,因此要访问列表的 ...
分类:
其他好文 时间:
2019-05-24 18:43:53
阅读次数:
118
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This ...
分类:
其他好文 时间:
2019-05-10 23:59:33
阅读次数:
228
下面是王恩哥校长的近照(取自《成都商报》): 5月18日,读毕媒体报道“北大校长:不是挣钱多当官大才是成功”一文有感。 老实说,此文不是给王恩哥校长“拍马屁”(我已年老退休),而是说说心里话。对其业绩不得不佩服。王恩哥校长。1957年出生。1987年进入北京大学物理系读硕士研究生。这三十年里面的辛苦 ...
分类:
其他好文 时间:
2019-04-30 17:14:21
阅读次数:
189
题目描述:https://leetcode cn.com/problems/letter combinations of a phone number/ 题目描述: 给定一个仅包含数字 的字符串,返回所有它能表示的字母组合。 给出数字到字母的映射如下(与电话按键相同)。注意 1 不对应任何字母。 示 ...
分类:
其他好文 时间:
2019-04-24 17:37:42
阅读次数:
119
Allowed Letters 最直观的想法是贪心取, 然后网络流取check可不可行, 然后T了。 想到最大流可以等于最小割, 那么我们状压枚举字符代表的6个点连向汇点是否断掉, 然后再枚举64个本质不同的位置, 是否需要切段原点联想它的边, 复杂度电磁check复杂度64 * 64 用sosdp ...
分类:
其他好文 时间:
2019-04-18 00:42:28
阅读次数:
196
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,where "adjace ...
分类:
其他好文 时间:
2019-04-02 21:23:43
阅读次数:
205
算法:深搜 代码一: 1 #include<iostream> 2 using namespace std; 3 int bb[26]={0},s,r,sum=1,s1=1; 4 char aa[25][25]; 5 int dir[4][2]={-1,0,1,0,0,-1,0,1}; 6 void ...
分类:
其他好文 时间:
2019-03-31 13:58:53
阅读次数:
142
There are few sadder sights than 8 pile of fan letters ,lovingly decorated with hand drawings,suffering in abin,The sparkly envelopes were addressed t ...
分类:
其他好文 时间:
2019-03-29 14:54:06
阅读次数:
203