码迷,mamicode.com
首页 >  
搜索关键字:leetcode easy    ( 39612个结果
【leetcode】Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:其他好文   时间:2014-07-22 23:16:35    阅读次数:373
[Leetcode] Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:其他好文   时间:2014-07-22 23:16:14    阅读次数:408
[leetcode] Anagrams
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.输入一个字符串数组,返回所有回文构词法(anagrams)的字符串,所谓回...
分类:其他好文   时间:2014-07-22 23:15:54    阅读次数:440
LeetCode:Reverse Words in a String
Reverse Words in a String题目链接:http://oj.leetcode.com/problems/reverse-words-in-a-string/ Given an input string, reverse the string word by word. F...
分类:其他好文   时间:2014-07-22 23:13:32    阅读次数:309
【leetcode刷题笔记】Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:其他好文   时间:2014-07-22 23:12:13    阅读次数:426
[leetcode]Sort List @ Python
原题地址:http://oj.leetcode.com/problems/sort-list/题意:链表的排序。要求:时间复杂度O(nlogn),空间复杂度O(1)。解题思路:由于题目对时间复杂度和空间复杂度要求比较高,所以查看了各种解法,最好的解法就是归并排序,由于链表在归并操作时并不需要像数组的...
分类:编程语言   时间:2014-04-30 15:09:41    阅读次数:428
[leetcode]4Sum @ Python
原题地址:http://oj.leetcode.com/problems/4sum/题意:从数组中找到4个数,使它们的和为target。要求去重,可能有多组解,需要都找出来。解题思路:一开始想要像3Sum那样去解题,时间复杂度为O(N^3),可无论怎么写都是Time Limited Exceeded...
分类:编程语言   时间:2014-04-30 13:28:46    阅读次数:445
[Leetcode] Valid Number
Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the problem stat...
分类:其他好文   时间:2014-04-29 16:45:45    阅读次数:398
测试Flask+PYTHON的WEB框架
参数URL:http://blog.csdn.net/qwiwuqo/article/details/8970621安装flask之前,你必须要先安装python和easy_install。安装 virtualenv,这个主要是用来做解释器环境隔离的,避免同一机器上的多个python或者多个pyth...
分类:编程语言   时间:2014-04-29 16:38:46    阅读次数:446
[leetcode]3Sum Closest @ Python
原题地址:http://oj.leetcode.com/problems/3sum-closest/题意:数组中每三个元素进行求和,找出所有和中大小最接近target的和,并返回这个和与target之间的差值。解题思路:使用一个变量mindiff来监测和与target之间的差值,如果差值为0,直接返...
分类:编程语言   时间:2014-04-29 16:37:46    阅读次数:432
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!