码迷,mamicode.com
首页 >  
搜索关键字:longest substring    ( 5540个结果
js中substring和substr的用法
substring 方法用于提取字符串中介于两个指定下标之间的字符substring(start,end)开始和结束的位置,从零开始的索引参数 描述start 必需。一个非负的整数,规定要提取的子串的第一个字符在 stringObject 中的位置。stop 可选。一个非负的整数,比要提取的子...
分类:Web程序   时间:2015-08-03 19:02:00    阅读次数:138
Oracle 常见函数使用汇总
INSTR用法:INSTR(string,subString,position,ocurrence)解释:string:源字符串 subString:要查找的子字符串 position:查找的开始位置.若起始位置为0,返回值为0;当起始位置为负数的时候,从右边开始查找。 ocurrence:源字符串...
分类:数据库   时间:2015-08-03 01:04:45    阅读次数:171
js获取PC机系统当前时间
new Date().toJSON().substring(0,19).replace(/-/gm,‘‘).replace(/:/gm,‘‘) 结果: "20150801T125030" Java获取当前时间传给前端: SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd-HH:mm:ss");...
分类:Web程序   时间:2015-08-01 22:10:43    阅读次数:158
leetCode 104.Maximum Depth of Binary Tree(二叉树最大深度) 解题思路和方法
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 思路:很基础的一个题,DFS即可。代码如下: /** * Defin...
分类:其他好文   时间:2015-08-01 22:08:25    阅读次数:140
The Longest Increasing Subsequence (LIS)
传送门十分重要的基础DP问题,是学习用各种方式优化DP的一个很好的例子。设DP[i]表示以a[i]结尾的LIS的长度,则状态转移方程为DP[1]=1DP[i] = max{DP[j], j1暴力求解复杂度为O(N^2)。优化1考虑函数f(L):长度为 L 的 Increasing Sequence ...
分类:其他好文   时间:2015-08-01 20:28:08    阅读次数:90
[leetcode 32]Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the longest valid parentheses substring is "()", ...
分类:其他好文   时间:2015-08-01 10:07:41    阅读次数:107
[LeetCode][Java] Palindrome Partitioning
题目: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. For example, given s = "aab", Return [ ...
分类:编程语言   时间:2015-07-31 23:35:54    阅读次数:196
javascript的slice(),splice(),split(),substring(),substr()
例子摘抄于http://www.w3school.com.cn/jsref/jsref_obj_array.asp1.slice();Array和String对象都有在Array中 slice(i,[j])i为开始截取的索引值,负数代表从末尾算起的索引值,-1为倒数第一个元素j为结束的索引值,缺省时...
分类:编程语言   时间:2015-07-31 18:08:04    阅读次数:161
Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:其他好文   时间:2015-07-31 16:08:47    阅读次数:103
LeetCode 14: Longest Common Prefix
Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings. 求最长公共前缀。 代码如下: class Solution { public: string longestCommonPrefix(vect...
分类:其他好文   时间:2015-07-30 19:28:27    阅读次数:109
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!