You have multiset of n strings of the same length, consisting of lowercase English letters. We will say that those strings are easy to
remember if for each string there is some position i and some l...
分类:
其他好文 时间:
2015-05-15 22:53:40
阅读次数:
136
You are given a string q. A sequence of k strings s1,?s2,?...,?sk is
called beautiful, if the concatenation of these strings is string q (formally,s1?+?s2?+?...?+?sk?=?q)
and the first characters ...
分类:
其他好文 时间:
2015-05-15 15:42:11
阅读次数:
186
试题请參见:https://oj.leetcode.com/problems/longest-common-prefix/题目概述Write a function to find the longest common prefix string amongst an array of strings...
分类:
其他好文 时间:
2015-05-15 15:13:04
阅读次数:
104
描述:
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
思路:
将字符串从后向前进行相加,最后有进位的话再创造新的位数,最后将字符串反转,输出即可。...
分类:
其他好文 时间:
2015-05-15 09:06:04
阅读次数:
99
描述:
Given two strings s and t, determine if they are isomorphic.
Two strings are isomorphic if the characters in s can be replaced to get t.
All occurrences of a character must be replaced with another character while preserving the order of characters....
分类:
其他好文 时间:
2015-05-15 09:03:17
阅读次数:
111
Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ...
分类:
其他好文 时间:
2015-05-15 01:14:06
阅读次数:
125
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.解题思路:首先要理解,什么是anagrams,ie。“tea”、“tae”...
分类:
编程语言 时间:
2015-05-15 01:14:02
阅读次数:
186
题意:如果两个字符串是对称的,就返回true。对称就是将串1中的同一字符都一起换掉,可以换成同串2一样的。思路:ASCII码表哈希就行了。需要扫3次字符串,共3*n的计算量。复杂度O(n)。从串左开始扫,若字符没有出现过,则赋予其一个特定编号,在哈希表中记录,并将该字符改成编号。对串2同样处理。其实...
分类:
其他好文 时间:
2015-05-15 01:03:36
阅读次数:
126
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega...
分类:
其他好文 时间:
2015-05-14 21:59:58
阅读次数:
104
Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All occurrences of a ...
分类:
其他好文 时间:
2015-05-14 20:28:37
阅读次数:
115