码迷,mamicode.com
首页 >  
搜索关键字:substring with conca    ( 3920个结果)
求解最长回文子串
// A O(n^2) time and O(1) space program to find the longest palindromic substring#include // A utility function to print a substring str[low..high]voi...
分类:其他好文   时间:2015-05-22 00:28:09    阅读次数:110
2555: SubString 后缀自动机+LCT
2555: SubStringTime Limit: 30 SecMemory Limit: 512 MBSubmit: 688Solved: 235[Submit][Status][Discuss]Description懒得写背景了,给你一个字符串init,要求你支持两个操作(1):在当前字符串的...
分类:其他好文   时间:2015-05-21 22:29:29    阅读次数:257
js小工具
1、 var phone = $("#phone").val(); var arg = phone.split('-');//根据-分割phone sub = phone.substring(4,5) //同java 取第四个字段2、竖线分割把下拉框值和标石都显示,以便在下个界面调用$("#o...
分类:Web程序   时间:2015-05-21 21:49:45    阅读次数:132
leetcode 3 -- Longest Substring Without Repeating Characters
leetcode 3 – Longest Substring Without Repeating Characters 题目: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without r...
分类:其他好文   时间:2015-05-21 17:27:00    阅读次数:110
写OO作业过程中现学的东西
获取后缀名—— String latter = name.substring(name.lastIndexOf(".") + 1); //不包括".",比如"java",而不是".java" 将文件中的内容读入到String数组中—— BufferedReader br = null; try{ br = new BufferedReader(new File...
分类:其他好文   时间:2015-05-20 22:27:46    阅读次数:252
leetcode_Longest Common Prefix
有两种思路: 1.从0向最大的公共前缀长度进行,i=0,即每次从0循环至strs.length,所有的字符都相等,则count++,直至有一个字符不相同为止,循环终止 2.假设 longest common prefix 等于字符串数组的最短字符串的长度,从0循环至strs.length,在前面最长公共最大长度的基础上比较相邻两个串的最大公共子串 个人感觉还是第一种思路更好,用到的额外存储空间更少,时间也更短...
分类:其他好文   时间:2015-05-20 11:25:46    阅读次数:130
LeetCode 003. Longest Substring Without Repeating
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 length is 3. F...
分类:其他好文   时间:2015-05-20 02:18:57    阅读次数:100
【LeetCode】Longest Substring Without Repeating Characters
题目描述 问题分析 代码 总结 个人声明题目描述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”, whic...
分类:其他好文   时间:2015-05-18 18:54:52    阅读次数:99
JavaScript中字符串截取substring/substr/slice方法总结
最近整前台总多多少少遇到一些字符串截取的小问题,忍不住仔细看了下。接下来总结一下javascript中字符串截取方法的一些应用经验和区别。看了其他博主也有写到,各有风格况且只是个人随记,自己体会的才最深刻。 一些看似简单深究又大有文章的东西弄懂了你才知道自己所学甚浅,部分内容是w3cSchool原....
分类:编程语言   时间:2015-05-18 16:09:24    阅读次数:156
Java [leetcode 30]Substring with Concatenation of All Words
题目描述:You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a ...
分类:编程语言   时间:2015-05-16 17:44:55    阅读次数:141
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!