码迷,mamicode.com
首页 >  
搜索关键字:longest substring    ( 5540个结果
Longest Palindromic Substring
原理参考:http://www.douban.com/note/321468038/public class Solution { public String longestPalindrome(String s) { if((s == null) || (s.length() ...
分类:其他好文   时间:2015-05-06 01:09:48    阅读次数:145
LeetCode 5 -- Longest Palindromic Substring
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...
分类:其他好文   时间:2015-05-05 23:42:33    阅读次数:168
LeetCode 3 Longest Substring Without Repeating Characters
Problem: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the lengt...
分类:其他好文   时间:2015-05-05 21:56:58    阅读次数:134
Oj练习42——T3 Longest Substring Without Repeating Characters
求一个字符串中不含重复字母的最大子串的长度。【思路】1.用临时tmp记录长度,遇到重复字母把tmp当前值赋给要返回的length,tmp归零比较tmp和length,当tmp>length时,更新length。2.每个字母向前遍历是否有重复字母,用哈希表。3.反复提交代码不能通过后看了题目tag,知...
分类:其他好文   时间:2015-05-05 19:15:55    阅读次数:156
JAVA 实现手机号码压缩,解压
String encodePhoneNumber(String number)     {         int encnum = Integer.parseInt(number.substring(2));         int prefix = (number.charAt(1) - '2') /2;   // '3'=>0, '5'=>1, '[67]'=>2, '8'=>3 ...
分类:移动开发   时间:2015-05-05 16:38:30    阅读次数:171
BITCOIN
目录1.block chain1.Block ChainBlocks in the main chain (black) are the longest series of blocks that go from the genesis block (green) to the current bl...
分类:其他好文   时间:2015-05-05 16:09:27    阅读次数:117
Longest Common Prefix
https://leetcode.com/problems/longest-common-prefix/Write a function to find the longest common prefix string amongst an array of strings 1 public cla...
分类:其他好文   时间:2015-05-04 23:58:12    阅读次数:271
substring substr slice js比较
stringObject.substring(start,stop) substring() 方法用于提取字符串中介于两个指定下标之间的字符。stringObject.substr(start,length) 必需。要抽取的子串的起始下标。必须是数值。如果是负数,那么该参数声明从字符串的尾部开始算起...
分类:Web程序   时间:2015-05-04 19:40:11    阅读次数:171
JS截取、分割字符串
/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*var str = "0123456789";alert(str.substring(0));------------"012345...
分类:Web程序   时间:2015-05-04 15:23:35    阅读次数:130
Java [leetcode 14] Longest Common Prefix
小二好久没有更新博客了,真是罪过,最近在看linux的东西导致进度耽搁了,所以今晚睡觉前怒刷一题!问题描述:Write a function to find the longest common prefix string amongst an array of strings.解题思路:该问题就是...
分类:编程语言   时间:2015-05-04 01:12:56    阅读次数:534
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!