翻译给定两个字符串s和t,写一个函数来确定是否t是s的字谜。例如,
s = "anagram", t = "nagaram", 返回true
s = "rat", t = "car", 返回false备注:
你可以假设字符串只包含小写字母。跟进:
如果输入包含unicode字符该怎么做?你的解决方案能够适应这种情况吗?原文Given two strings s and t, write a func...
分类:
其他好文 时间:
2016-01-12 01:25:40
阅读次数:
212
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2016-01-12 01:07:01
阅读次数:
218
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...
分类:
其他好文 时间:
2016-01-11 22:07:22
阅读次数:
104
创建两个数组 分别记录两个字符串 各个位置字符出现的上一个位置 通过比较当前字符的上一个位置是否相同 判断是否同构比较坑爹的是 一开始以为只有字母 所以纠结于怎么找出字母来。。。代码如下:public class IsomorphicStrings { public static boolean ....
分类:
其他好文 时间:
2016-01-11 06:50:17
阅读次数:
203
基本类型像基本的JavaScript一样,TypeScript支持numbers, strings, structures, boolean等基本类型,而扩展的enum等类型,为编程提供了更多帮助。Boolean这是最简单的类型var isDone: boolean = false;Number在J...
分类:
其他好文 时间:
2016-01-10 11:33:25
阅读次数:
136
Longest Common Prefix:Write a function to find the longest common prefix string amongst an array of strings. 题意:查找一个字符串数组中的字符串的最长公共子序列。 思路:首先查找字符串数组中,...
分类:
其他好文 时间:
2016-01-10 10:29:45
阅读次数:
137
Stringa="a"+"b"+"c"创建了几个对象这个问题涉及到了字符串常量池和字符串拼接Stringa="a"+"b"+"c"通过编译器优化后,得到的效果是Stringa="abc"Java中字符串对象创建有两种形式,一种为字面量形式,如Stringstr="droid";另一种就是使用new这种标准的构造对象的方法,如Strings..
分类:
其他好文 时间:
2016-01-09 18:45:38
阅读次数:
138
结合样例和下面图中的几种情况考虑即可解决。代码如下: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() { 7 int begin, end; 8 while (cin >> begi...
分类:
其他好文 时间:
2016-01-08 00:14:14
阅读次数:
196
LeetCode解题之Multiply Strings原题将两个用字符串表示的数进行乘法操作并返回字符串结果。...
分类:
其他好文 时间:
2016-01-06 10:19:01
阅读次数:
126
Write a function to find the longest common prefix string amongst an array of strings.Subscribeto see which companies asked this question比较每个字符串的每个字符,...
分类:
其他好文 时间:
2016-01-03 22:23:07
阅读次数:
216