E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
leet
Leetcode 139:单词拆分(最详细的解法!!!)
示例1:输入:s="leetcode",wordDict=["
leet
","code"]输出:true解释:返回true因为"leetcode"可以被拆分成"leetcode"。
coordinate_blog
·
2018-10-03 18:06
Problems
leetcode解题指南
LeetCode139. 单词拆分
示例1:输入:s="leetcode",wordDict=["
leet
","code"]输出:true解释:返回true因为"leetcode"可以被拆分成"leetcode"。
Pi_dan
·
2018-09-05 21:04
算法
单词中断(LeetCode==>Word Break)
说明:1.词典中的同一个词可以在分割中重复使用多次你可以假设字典不包含重复的单词Example1:Input:s="leetcode",wordDict=["
leet
","code"]Output:trueExplanation
Katakuly
·
2018-09-01 22:55
java中保留2位小数的四种方法
packageCodeJava_
Leet
;importjava.math.BigDecimal;importjava.text.DecimalFormat;impo
givmchickenblood
·
2018-08-29 10:51
java
Leet
code 第一题 两数之和 JAVA python
一开始用了两个For循环写的,看了官方的解决方案发现复杂度太高,时间复杂度为O(N2)。然后发现用Hashmap更加简单一点:JAVA:classSolution{publicint[]twoSum(int[]nums,inttarget){Mapmap=newHashMap<>();for(inti=0;i
Jennygu96
·
2018-07-02 15:47
Leet
686-重复叠加字符串匹配(python)
题目描述:给定两个字符串A和B,寻找重复叠加字符串A的最小次数,使得字符串B成为叠加后的字符串A的子串,如果不存在则返回-1。举个例子,A="abcd",B="cdabcdab"。答案为3,因为A重复叠加三遍后为“abcdabcdabcd”,此时B是其子串;A重复叠加两遍后为"abcdabcd",B并不是其子串。注意:A与B字符串的长度在1和10000区间范围内。代码:classSolution:
raoboo
·
2018-05-18 20:42
Leetcode
数据结构和算法
本书对抽象做了很漂亮的工作;第一章讲述基础的数据结构第二章讲述线性结构和各种排序算法第三章讲述树数据结构及其性质第四章讲图算法:图算法真的很漂亮第五章讲字符串算法第六章展望然后,去leetcode强化练习吧
Leet
fromdtor
·
2018-05-16 15:20
数据结构和算法
本书对抽象做了很漂亮的工作;第一章讲述基础的数据结构第二章讲述线性结构和各种排序算法第三章讲述树数据结构及其性质第四章讲图算法:图算法真的很漂亮第五章讲字符串算法第六章展望然后,去leetcode强化练习吧
Leet
fromdtor
·
2018-05-16 15:20
算法总结一LeetCode
LeetCode14LeetCode6LeetCode242LeetCode520LeetCode58LeetCode696分治LeetCode169LeetCode53哈希LeetCode169LeetCode1LeetCode242LeetCode217LeetCode219
Leet
Pi_dan
·
2018-05-13 18:01
算法
js代码实现根据实际物理地址,进行 URL 跳转,并实现用户自定义 URL 跳转
="http://fuzhou.
leet
.com.c
Dragon1993vsLong
·
2018-01-10 17:57
.net
js
Leet
Code(一)两个数组元素的和为给定制值
给定一个整形数组和一个整数target,返回2个元素的下标,它们满足相加的和为target。你可以假定每个输入,都会恰好有一个满足条件的返回结果。(时间复杂度O(n)):publicstaticvoidmain(String[]args){int[]main={1,2,5,6,8,7};System.out.println("11111111111111+22222222222");System.
weiweichelaixi
·
2017-12-01 09:20
java
leet
-code最长公共子序列&最长非公共子序列
今天本来是要做最长非公共子序列的,很简单的一个问题;被我做着做着做成了最长公共子序列。再也不怕子序列了!1.最长公共子序列目前对动态规划还不是很熟悉,所以还是使用暴力破解,a和b两个字符串,按照下述方式进行操作:1.1从a中挑出子序列,子序列长度从长到短1.2对于每一个a中挑出的子序列,从b中挑与之长度相同的的子序列进行比较,如果相等,则为一个公共子序列;也是最长公共子序列之一1.3综合1.2可以
leehaming
·
2017-07-20 09:29
编程学习
java
算法相关文章索引(4)
RemoveLinkedListElementsLeetCode203-RemoveLinkedList Elements LeetCode495-TeemoAttackingLeetCode313-SuperUgly Number
Leet
BlackEnn
·
2017-06-16 11:00
java
编程
算法
python
算法相关文章索引(4)
RemoveLinkedListElementsLeetCode203-RemoveLinkedList Elements LeetCode495-TeemoAttackingLeetCode313-SuperUgly Number
Leet
BlackEnn
·
2017-06-16 11:00
java
编程
算法
python
Leet
#257 Binary Tree Paths
publicListbinaryTreePaths(TreeNoderoot){Listlist=newArrayListlist,Stringpath){Stringval=String.valueOf(root.val);if(root.left!=null&root.right!=null){path=path+val+"->";findpath(root.left,list,path);f
尴尴尬尬先生
·
2017-05-05 15:44
韩国男女爱豆、演员撞脸合集:吴亦凡、鹿晗、Got7、BTS等
2、李泰民&Kai李泰民(
LeeT
若雪
·
2017-03-15 10:08
Leet
code -- Combination Sum系列整理
CombinationSumIGivenasetofcandidatenumbers(C)(withoutduplicates)andatargetnumber(T),findalluniquecombinationsinCwherethecandidatenumberssumstoT.ThesamerepeatednumbermaybechosenfromCunlimitednumberofti
proheart
·
2017-03-08 00:00
leetcode
算法
java
用 Swift 来刷
leet
code 吧 (1-20)
前言为什么要用Swift刷leetcode?因为我有两个想法,一是学Swift并且有机会练练,二是想把leetcode刷完。于是,这两个想法就合二为一了,现在我以基本一天一道的速度在刷。Swift适合用来刷leetcode吗?现在做了20多道题,我个人的意见是不适合。可能比纯C好写,但没有主流的语言java、python好写。首先Swift这门语言效率不高,有些算法拿别的语言过得去,拿Swift就
戴仓薯
·
2017-01-17 17:33
认识自我,提高原动力
但用这些也要注意方法,比如刷leetcode,就一定在提交前
Leet
一遍,检查codingstyle是否正确;用到linkedcode时,一定要bugfree;
AriesKean
·
2016-11-26 00:23
经验随笔
leetcode: Word Break
canbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens = "leetcode",dict = ["
leet
frank-liu
·
2016-07-05 23:00
Leet
Code OJ 91. Decode Ways [Difficulty: Medium]
题目:AmessagecontaininglettersfromA-Zisbeingencodedtonumbersusingthefollowingmapping:'A'->1 'B'->2 ... 'Z'->26Givenanencodedmessagecontainingdigits,determinethetotalnumberofwaystodecodeit.Forexample,Giv
Lnho2015
·
2016-06-24 13:00
LeetCode
算法
字符串
编码
解码
Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="leetcode",dict=["
leet
yeshiwu
·
2016-06-23 14:00
java
LeetCode
动态规划
Leet
Code OJ 344. Reverse String [Difficulty: Easy]
题目:Writeafunctionthattakesastringasinputandreturnsthestringreversed.Example:Givens=“hello”,return“olleh”.翻译:写一个函数,使用字符串作为输入,返回它反转后的结果。例如,输入”hello”,返回”olleh”。分析:转为字符数组后,将第一个字符和最后一个字符对调,第二个字符和倒数第二个对调,以此
Lnho2015
·
2016-06-23 13:00
LeetCode
算法
String
leetcode Word Break
状态转移方程:f(i)表示s[0,i]是否可以分词f(i)=f(j)&&f(j+1,i);0dict=newHashSet();dict.add("
leet
");dict.add("code");WordBreaksolution
e01014165
·
2016-06-03 21:21
动态规划
Middle-题目92:139. Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens=“leetcode”,dict=[“
leet
cmershen
·
2016-05-31 19:00
LeetCode Word Break
注意点:无例子:输入:s=“leetcode”,wordDict={“
leet
”,“code”}输出:True解题思路采用动态规划的方法解决,dp[i]表示字符串s[:i]能否拆分成符合要求的子字符串。
u013291394
·
2016-05-04 21:00
LeetCode
算法
python
动态规划
Leet
Code OJ 15. 3Sum[Difficulty: Medium]
题目:GivenanarraySofnintegers,arethereelementsa,b,cinSsuchthata+b+c=0?Findalluniquetripletsinthearraywhichgivesthesumofzero.Note:Elementsinatriplet(a,b,c)mustbeinnon-descendingorder.(ie,a≤b≤c)Thesolutio
Lnho2015
·
2016-05-04 13:00
java
LeetCode
算法
数组
3Sum
leetcode——139——Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="leetcode",dict=["
leet
happyxuma1991
·
2016-05-01 23:00
Leet
Code OJ 28. Implement strStr() [Difficulty: Easy]
题目:ImplementstrStr().Returnstheindexofthefirstoccurrenceofneedleinhaystack,or-1ifneedleisnotpartofhaystack.翻译:实现一个方法strStr()。返回字符串needle第一次在字符串haystack出现的下标,如果needle不是haystack的一部分,就返回-1。分析:在文本中查找某个模式出
Lnho2015
·
2016-04-28 16:00
LeetCode
算法
KMP
字符串匹配算法
LeetCode 139. Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="leetcode",dict=["
leet
github_34333284
·
2016-04-24 03:00
LeetCode-139.Word Break
canbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens = "leetcode",dict = ["
leet
zmq570235977
·
2016-04-21 13:00
LeetCode
动态规划
【一天一道LeetCode】#22. Generate Parentheses
writeafunctiontogenerateallcombinationsofwell-formedparentheses.Forexample,givenn=3,asolutionsetis:“((()))”,“(()())”,“(())()”,“()(())”,“()()()”(二)解题在【一天一道
Leet
terence1212
·
2016-04-20 22:00
LeetCode
剑指Offer--017-合并两个排序的链表
Offer–017-合并两个排序的链表牛客OJ九度OJCSDN题解GitHub代码合并两个排序的链表1519-合并两个排序的链表剑指Offer–017-合并两个排序的链表017-合并两个排序的链表其实这道题跟
Leet
gatieme
·
2016-04-12 23:00
github
算法
面试
链表
合并
SVN使用教程总结
原文链接:https://my.oschina.net/
leet
123/blog/653262SVN简介:为什么要使用SVN?
chulai4080
·
2016-04-06 09:00
Leet
Code OJ 14. Longest Common Prefix [Difficulty: Easy]
题目:Writeafunctiontofindthelongestcommonprefixstringamongstanarrayofstrings.翻译:写一个函数去找到在字符串数组里面的最长的前缀字符串。分析:首先考虑字符串数组的length为0和为1的情况,为1的情况如果不预先处理,后面判断起来会比较麻烦。然后需要找出这些字符串的最短的长度,超过这个长度是否匹配已经没有意义。Java版代码:
Lnho2015
·
2016-03-25 18:00
LeetCode
算法
字符串
最长前缀
Leet
Code OJ 14. Longest Common Prefix [Difficulty: Easy]
题目:Writeafunctiontofindthelongestcommonprefixstringamongstanarrayofstrings.翻译:写一个函数去找到在字符串数组里面的最长的前缀字符串。分析:首先考虑字符串数组的length为0和为1的情况,为1的情况如果不预先处理,后面判断起来会比较麻烦。然后需要找出这些字符串的最短的长度,超过这个长度是否匹配已经没有意义。Java版代码:
Lnho2015
·
2016-03-25 18:00
LeetCode
算法
字符串
最长前缀
Leet
Code OJ 125. Valid Palindrome [Difficulty: Easy]
题目:Givenastring,determineifitisapalindrome,consideringonlyalphanumericcharactersandignoringcases.Forexample,“Aman,aplan,acanal:Panama”isapalindrome.“raceacar”isnotapalindrome.Note:Haveyouconsiderthatt
Lnho2015
·
2016-03-25 13:00
LeetCode
算法
字符串
回文
字符对称
Leet
Code OJ 125. Valid Palindrome [Difficulty: Easy]
题目:Givenastring,determineifitisapalindrome,consideringonlyalphanumericcharactersandignoringcases.Forexample,“Aman,aplan,acanal:Panama”isapalindrome.“raceacar”isnotapalindrome.Note:Haveyouconsiderthatt
Lnho2015
·
2016-03-25 13:00
LeetCode
算法
字符串
回文
字符对称
Leet
Code OJ 20. Valid Parentheses [Difficulty: Easy]
题目:Givenastringcontainingjustthecharacters,determineiftheinputstringisvalid.Thebracketsmustcloseinthecorrectorder,“()”and“()[]{}”areallvalidbut“(]”and“([)]”arenot.翻译:给定一个字符串,只包含’(‘,‘)’,‘{‘,‘}’,‘[’和’]’
Lnho2015
·
2016-03-24 13:00
LeetCode
算法
栈
括号
Leet
Code OJ 20. Valid Parentheses [Difficulty: Easy]
题目:Givenastringcontainingjustthecharacters,determineiftheinputstringisvalid.Thebracketsmustcloseinthecorrectorder,“()”and“()[]{}”areallvalidbut“(]”and“([)]”arenot.翻译:给定一个字符串,只包含’(‘,‘)’,‘{‘,‘}’,‘[’和’]’
Lnho2015
·
2016-03-24 13:00
LeetCode
算法
栈
括号
Leet
Code OJ 2. Add Two Numbers [Difficulty: Medium]
题目:Youaregiventwolinkedlistsrepresentingtwonon-negativenumbers.Thedigitsarestoredinreverseorderandeachoftheirnodescontainasingledigit.Addthetwonumbersandreturnitasalinkedlist.Input:(2->4->3)+(5->6->4)
Lnho2015
·
2016-03-23 13:00
LeetCode
算法
链表
Leet
Code OJ 2. Add Two Numbers [Difficulty: Medium]
题目:Youaregiventwolinkedlistsrepresentingtwonon-negativenumbers.Thedigitsarestoredinreverseorderandeachoftheirnodescontainasingledigit.Addthetwonumbersandreturnitasalinkedlist.Input:(2->4->3)+(5->6->4)
Lnho2015
·
2016-03-23 13:00
LeetCode
算法
链表
Leet
Code OJ 119. Pascal's Triangle II [Difficulty: Easy]
题目:Givenanindexk,returnthekthrowofthePascal’striangle.Forexample,givenk=3,Return[1,3,3,1].Note:CouldyouoptimizeyouralgorithmtouseonlyO(k)extraspace?翻译:给定一个下标k,返回第k行的杨辉三角。例如给定k=3,返回[1,3,3,1]。提示:你可以优化你的
Lnho2015
·
2016-03-22 13:00
LeetCode
算法
杨辉三角
帕斯卡三角形
贾宪三角形
Leet
Code OJ 119. Pascal's Triangle II [Difficulty: Easy]
题目:Givenanindexk,returnthekthrowofthePascal’striangle.Forexample,givenk=3,Return[1,3,3,1].Note:CouldyouoptimizeyouralgorithmtouseonlyO(k)extraspace?翻译:给定一个下标k,返回第k行的杨辉三角。例如给定k=3,返回[1,3,3,1]。提示:你可以优化你的
Lnho2015
·
2016-03-22 13:00
LeetCode
算法
杨辉三角
帕斯卡三角形
贾宪三角形
Leet
Code OJ 118. Pascal's Triangle [Difficulty: Easy]
题目:GivennumRows,generatethefirstnumRowsofPascal’striangle.Forexample,givennumRows=5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ]翻译:给定一个数numRows,产生前numRows行的杨辉三角(即贾宪三角形、帕斯卡三角形)。分析:除了每行首尾是1以外,其
Lnho2015
·
2016-03-22 11:00
LeetCode
算法
杨辉三角
帕斯卡三角形
贾宪三角形
Leet
Code OJ 118. Pascal's Triangle [Difficulty: Easy]
题目:GivennumRows,generatethefirstnumRowsofPascal’striangle.Forexample,givennumRows=5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ]翻译:给定一个数numRows,产生前numRows行的杨辉三角(即贾宪三角形、帕斯卡三角形)。分析:除了每行首尾是1以外,其
Lnho2015
·
2016-03-22 11:00
LeetCode
算法
杨辉三角
帕斯卡三角形
贾宪三角形
Leet
Code OJ 8. String to Integer (atoi) [Difficulty: Easy]
题目:Implementatoitoconvertastringtoaninteger.Hint:Carefullyconsiderallpossibleinputcases.Ifyouwantachallenge,pleasedonotseebelowandaskyourselfwhatarethepossibleinputcases.Notes:Itisintendedforthisprobl
Lnho2015
·
2016-03-22 10:00
java
LeetCode
算法
字符串转数字
atoi
Leet
Code OJ 8. String to Integer (atoi) [Difficulty: Easy]
题目:Implementatoitoconvertastringtoaninteger.Hint:Carefullyconsiderallpossibleinputcases.Ifyouwantachallenge,pleasedonotseebelowandaskyourselfwhatarethepossibleinputcases.Notes:Itisintendedforthisprobl
Lnho2015
·
2016-03-22 10:00
java
LeetCode
算法
字符串转数字
atoi
Word Break [Leetcode解题报告]
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens=“leetcode”,dict=[“
leet
zhouyusong_bupt
·
2016-03-20 15:00
LeetCode
String
word
Leet
Code OJ 338. Counting Bits [Difficulty: Medium]
题目:Givenanonnegativeintegernumbernum.Foreverynumbersiintherange0≤i≤numcalculatethenumberof1’sintheirbinaryrepresentationandreturnthemasanarray.Example:Fornum=5youshouldreturn[0,1,1,2,1,2].Followup:Iti
Lnho2015
·
2016-03-18 18:00
LeetCode
算法
数组
二进制表示
上一页
8
9
10
11
12
13
14
15
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他