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
Leet
Code OJ 263. Ugly Number [Difficulty: Easy]
题目:Writeaprogramtocheckwhetheragivennumberisanuglynumber.Uglynumbersarepositivenumberswhoseprimefactorsonlyinclude2,3,5.Forexample,6,8areuglywhile14isnotuglysinceitincludesanotherprimefactor7.Notethat
Lnho2015
·
2016-02-27 17:00
算法
Leet
Code OJ 169. Majority Element [Difficulty: Easy]
题目:Givenanarrayofsizen,findthemajorityelement.Themajorityelementistheelementthatappearsmorethan⌊n/2⌋times.Youmayassumethatthearrayisnon-emptyandthemajorityelementalwaysexistinthearray.思路分析:题意是给定一个长度为n
Lnho2015
·
2016-02-26 18:00
算法
Leet
Code OJ 217. Contains Duplicate [Difficulty: Easy]
题目:Givenanarrayofintegers,findifthearraycontainsanyduplicates.Yourfunctionshouldreturntrueifanyvalueappearsatleasttwiceinthearray,anditshouldreturnfalseifeveryelementisdistinct.思路分析:题意是给定一个整形数组,如果里面的元
Lnho2015
·
2016-02-26 18:00
算法
Leet
Code OJ 283. Move Zeroes [Difficulty: Easy]
题目:Givenanarraynums,writeafunctiontomoveall0’stotheendofitwhilemaintainingtherelativeorderofthenon-zeroelements.Forexample,givennums=[0,1,0,3,12],aftercallingyourfunction,numsshouldbe[1,3,12,0,0].Note
Lnho2015
·
2016-02-26 14:00
算法
Leet
Code OJ 226. Invert Binary Tree [Difficulty: Easy]
题目:Invertabinarytree.4/\27/\/\1369to4/\72/\/\9631思路分析:题意是将二叉树所有左右子数对调,如上图所示。具体做法是,先递归处理左右子树,然后将当前的左右子树对调。代码实现:/** *Definitionforabinarytreenode. *publicclassTreeNode{ *intval; *TreeNodeleft; *TreeNode
Lnho2015
·
2016-02-26 14:00
Leet
Code OJ 104. Maximum Depth of Binary Tree [Difficulty: Easy]
题目:Givenabinarytree,finditsmaximumdepth.Themaximumdepthisthenumberofnodesalongthelongestpathfromtherootnodedowntothefarthestleafnode.代码实现:/***Definitionforabinarytreenode.*publicclassTreeNode{*intval;
Lnho2015
·
2016-02-26 14:00
算法
Leet
Code OJ 258. Add Digits [Difficulty: Easy]
题目:Givenanon-negativeintegernum,repeatedlyaddallitsdigitsuntiltheresulthasonlyonedigit.Forexample:Givennum=38,theprocessislike:3+8=11,1+1=2.Since2hasonlyonedigit,returnit.Followup:Couldyoudoitwithouta
Lnho2015
·
2016-02-26 14:00
Leet
Code OJ 231. Power of Two [Difficulty: Easy]
题目:Givenaninteger,writeafunctiontodetermineifitisapoweroftwo.分析:题意是给定一个整数,判断它是不是2的幂。代码实现:publicclassSolution{ publicbooleanisPowerOfTwo(intn){ if(n<1){ returnfalse; } if(n==1){ returntrue; } if((n&1)=
Lnho2015
·
2016-02-26 13:00
算法
Leet
Code OJ 242. Valid Anagram [Difficulty: Easy]
题目:Giventwostringssandt,writeafunctiontodetermineiftisananagramofs.Forexample,s=“anagram”,t=“nagaram”,returntrue.s=“rat”,t=“car”,returnfalse.Note:Youmayassumethestringcontainsonlylowercasealphabets.Fo
Lnho2015
·
2016-02-26 12:00
算法
Leet
Code OJ 292. Nim Game [Difficulty: Easy]
题目:YouareplayingthefollowingNimGamewithyourfriend:Thereisaheapofstonesonthetable,eachtimeoneofyoutaketurnstoremove1to3stones.Theonewhoremovesthelaststonewillbethewinner.Youwilltakethefirstturntoremove
Lnho2015
·
2016-02-26 12:00
游戏
算法
Leet
Code OJ 136. Single Number [Difficulty: Medium]
题目:Givenanarrayofintegers,everyelementappearstwiceexceptforone.Findthatsingleone.Note:Youralgorithmshouldhavealinearruntimecomplexity.Couldyouimplementitwithoutusingextramemory?分析:题意是给定一个数组,该数组除了一个元素只
Lnho2015
·
2016-02-26 11:00
算法
leetcode Increasing Triplet Subsequence
leetcodeIncreasingTripletSubsequenceGivenanunsortedarrayreturnwhetheranincreasingsubsequenceoflength3existsornotinthearray.Formallythefunctionshould:Returntrueifthereexists i,j,k suchthat arr[i]
leet
murmured
·
2016-02-16 14:00
Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="leetcode",dict=["
leet
KickCode
·
2016-02-14 12:08
动态规划
leet
_14 Longest Common Prefix
packagecom.mingxin.leetcode.
leet
_14; /** *CreatedbyAdministratoron2016/1/25. */ publicclassLongestCommonPrefix
狂暴的小学生
·
2016-01-26 10:00
leet
_15
Givenanarray S of n integers,arethereelements a, b, c in S suchthat a + b + c =0?Findalluniquetripletsinthearraywhichgivesthesumofzero.Note:Elementsinatriplet(a,b,c)mustbeinnon-descendingorder.(ie, a
狂暴的小学生
·
2016-01-26 10:00
leet
_11
题目:https://leetcode.com/problems/container-with-most-water/Given n non-negativeintegers a1, a2,..., an,whereeachrepresentsapointatcoordinate(i, ai). n verticallinesaredrawnsuchthatthetwoendpointsoflin
狂暴的小学生
·
2016-01-26 10:00
leetcode笔记:Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="leetcode",dict=["
leet
liyuefeilong
·
2016-01-25 23:00
LeetCode
Algorithm
C++
算法
String
Leetcode题解——Word Break
canbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens = "leetcode",dict = ["
leet
u010025211
·
2016-01-06 17:00
LeetCode
dp
recursive
Leet
题目整理归类 - 快速通道 (持续更新)
刷
Leet
5个月了,先总结一下,这里算是每题的快速通道。自己做个记录便于以后重温算法。如果能帮到别人就更好了。本人是算法新手,如果对于一些题目读者有更好的实现方法,如能不吝赐教,万分感谢。
csharp25
·
2015-12-02 17:00
LeetCode --Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="leetcode",dict=["
leet
csharp25
·
2015-12-02 10:00
【LEETCODE】219-Contains Duplicate II
findoutwhethertherearetwodistinctindicesiandjinthearraysuchthatnums[i]=nums[j]andthedifferencebetweeniandjisatmostk.参考:http://bookshadow.com/weblog/2015/05/29/
leet
aliceyangxi1987
·
2015-11-27 15:00
LeetCode
python
【leetcode】Word Break(java)
canbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens = "leetcode",dict = ["
leet
过客航
·
2015-11-19 16:00
java
LeetCode
leetcode Word Break-单词划分
例如s = “leetcode” ,dict = {“
leet
”,“code”},那么s可以由dict中的单词组成。
·
2015-11-13 14:42
LeetCode
leetcode[139] Word Break
例如: For example, givens = "leetcode",dict = ["
leet
", "
·
2015-11-13 12:42
LeetCode
总结一下Word Break I 和 II
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="leetcode",dict=["
leet
u011029779
·
2015-11-12 06:00
Algorithm
LeetCode
面试题
[leetcode]Word Break
但是如果自底向上求的话会计算很多不需要的,比如
leet
已经在字典里了,很多情况下就不需要计算下面的l,e,e,t了,所以自顶向下递归+备忘录会是更
·
2015-11-11 09:12
LeetCode
[itint5]合并K个有序链表
merge sort,
leet
code里面曾经做过。但一开始没这么写,遍历来做,效率n*k了,用了merge sort后,变成logn*k。 用了dummy node。
·
2015-11-10 21:17
int
Python标准库——一日一库
printsprintstring.capwords(s,None)
leet
=string.maketrans('abcdefg','1234567')printsprints.translate(
leet
duzhuqi
·
2015-11-08 22:37
Python
Leet
Palindrome Partitioning II
1 class Solution { 2 public: 3 int minCut(string s) { 4 int len = s.length(); 5 int* p_dp = new int[len + 1]; 6 char* s_dp = new char[len * len]; 7 in
·
2015-11-02 19:09
partition
java工程开发之图形化界面之(第二课)
例如:public static final int Y_
LEET
_EYE = Y_R
·
2015-10-31 09:43
java
LeetCode-Reverse Words in a String[AC源码]
1 package com.lw.
leet
1; 2 3 import java.util.Stack; 4 5 /** 6 * @ClassName:Solution 7
·
2015-10-30 12:41
LeetCode
LeetCode-Insertion Sort List[AC源码]
1 package com.lw.
leet
5; 2 3 /** 4 * @ClassName:Solution 5 * @Description: 6 *
·
2015-10-23 09:55
LeetCode
LeetCode-Max Points on a Line[AC源码]
1 package com.lw.
leet
3; 2 3 import java.util.HashMap; 4 import java.util.Iterator; 5 import
·
2015-10-23 09:55
LeetCode
LeetCode-Sort List[AC源码]
package com.lw.
leet
4; /** * @ClassName:Solution * @Description: * Sort List *
·
2015-10-23 09:55
LeetCode
LeetCode-Evaluate Reverse Polish Notation[AC源码]
1 package com.lw.
leet
2; 2 3 /** 4 * @ClassName:Solution 5 * @Description: 6 *
·
2015-10-23 09:54
LeetCode
【
Leet
Code】Palindrome Number
Palindrome Number Total Accepted: 19369 Total Submissions: 66673 My Submissions Determine whether an integer is a palindrome. Do this without extra space. 推断一
·
2015-10-23 08:33
number
LeetCode -- Word Break 动态规划,详细理解
canbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens = "leetcode",dict = ["
leet
Crazy兔子
·
2015-09-05 20:00
Leetcode: Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens=“leetcode”,dict=[“
leet
ayst123
·
2015-08-29 12:00
Word Break && Word Break II
Forexample,given s="leetcode", dict=["
leet
"
yujin753
·
2015-08-26 21:00
LeetCode
Leet
-- Plus One
题目描述:Givenanon-negativenumberrepresentedasanarrayofdigits,plusonetothenumber.Thedigitsarestoredsuchthatthemostsignificantdigitisattheheadofthelist.给定1个数组,完成加1的操作。本题和大整数加法非常类似。逻辑比较简单,直接实现就可以了当前位=num[i]
csharp25
·
2015-08-25 16:00
Leet
-- Remove Duplicates from Sorted Array
题目描述:Givenasortedarray,removetheduplicatesinplacesuchthateachelementappearonlyonceandreturnthenewlength.Donotallocateextraspaceforanotherarray,youmustdothisinplacewithconstantmemory.Forexample,Givenin
csharp25
·
2015-08-22 22:00
【LeetCode-面试算法经典-Java实现】【139-Word Break(单词拆分)】
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="
leet
derrantcm
·
2015-08-19 06:31
LeetCode
LeetCode
【LeetCode-面试算法经典-Java实现】【139-Word Break(单词拆分)】
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="
leet
DERRANTCM
·
2015-08-19 06:00
java
算法
面试
拆分
单词
【LeetCode-面试算法经典-Java实现】【139-Word Break(单词拆分)】
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="
leet
DERRANTCM
·
2015-08-19 06:00
java
算法
面试
拆分
单词
[leetcode 139]Word Break
canbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens = "leetcode",dict = ["
leet
ER_Plough
·
2015-08-04 16:00
LeetCode
dp
break
word
139
[CareerCup] 3.2 Min Stack 最小栈
Leet
·
2015-07-25 12:00
stack
Leet
Code -- Unique BST
对于数字n(大于1),从1到n有多少种binarysearchtree(BST序列)?当n=3时,BST序列为: 1 3 3 2 1 \ / / /\ \ 3 2 1 1 3 2 / / \ \ 2 1 2 3共5种。分析:N=1时,BST序列为 1 / \ null null1种N=2时,B
csharp25
·
2015-07-23 12:00
LeetCode139:Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens=“leetcode”,dict=[“
leet
u012501459
·
2015-07-02 00:00
leetcode_Multiply Strings
Thenumberscanbearbitrarilylargeandarenon-negative.思路:简而言之,要实现的就是BigInteger(a).Multiply(BigInteger(b))的功能,但很显然,
leet
dfb198998
·
2015-06-30 17:00
strings
Multiply
leetcode--Word Break
determineifscanbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Forexample,givens="leetcode",dict=["
leet
kangaroo835127729
·
2015-06-19 17:00
上一页
9
10
11
12
13
14
15
16
下一页
按字母分类:
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
其他