码迷,mamicode.com
首页 >  
搜索关键字:problems    ( 6275个结果
LeetCode-Spiral Matrix
题目链接:https://oj.leetcode.com/problems/spiral-matrix/ 题目内容: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. For example, Given the follo...
分类:其他好文   时间:2015-01-22 09:32:41    阅读次数:186
[LeetCode][Python]18: 4Sum
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'18: 4Sumhttps://oj.leetcode.com/problems/4sum/Given an array S of n integers, are there el...
分类:编程语言   时间:2015-01-22 01:37:23    阅读次数:239
[LeetCode][Python]17: Letter Combinations of a Phone Number
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'17: Letter Combinations of a Phone Numberhttps://oj.leetcode.com/problems/letter-combinati...
分类:编程语言   时间:2015-01-22 00:04:47    阅读次数:308
LeetCode Binary Tree Level Order Traversal
传送门:https://oj.leetcode.com/problems/binary-tree-level-order-traversal/Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, ...
分类:其他好文   时间:2015-01-21 13:22:25    阅读次数:151
[LeetCode][Python]16: 3Sum Closest
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'16: 3Sum Closesthttps://oj.leetcode.com/problems/3sum-closest/Given an array S of n intege...
分类:编程语言   时间:2015-01-21 06:37:11    阅读次数:170
[LeetCode][Python]15:3Sum
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'15: 3Sumhttps://oj.leetcode.com/problems/3sum/Given an array S of n integers, are there el...
分类:编程语言   时间:2015-01-21 06:34:04    阅读次数:177
[Leetcode] 19 - Remove Nth Node From End of List
原题链接:https://oj.leetcode.com/problems/remove-nth-node-from-end-of-list/ 这道题是移除倒数第n个node,做法是保持2个指针,一快一慢,快指针先走n步,然后快慢指针同时走,直到快指针变成null。这时将慢指针的值改为next的值。(注意,慢指针其实是指针的指针,以为为了改变指向当前node的指针的值)。个人感觉这题其实...
分类:其他好文   时间:2015-01-20 17:59:27    阅读次数:145
[Leetcode] 16 - 3Sum Closest
原题链接:https://oj.leetcode.com/problems/3sum-closest/ 这道题基本就是3sum的变形,就直接按照3sum先排序,然后取当前数,再左右指针对于后面的数组向内扫描,但是因为是求closest,只有diff = 0的时候才能完全跳出当前循环,否则则需要继续扫描直到相遇或diff = 0。 所以复杂度是排序时间加上扫描时间O(nlogn ...
分类:其他好文   时间:2015-01-20 15:52:14    阅读次数:171
[HackerCup Round1 3] Winning at Sports (动态规划)
题目链接:https://www.facebook.com/hackercup/problems.php?pid=688426044611322&round=344496159068801题目大意:两种赢法,一种叫做stress-free,另外一种叫做stressful。问你给定最终成绩,stres...
分类:Windows程序   时间:2015-01-20 15:39:22    阅读次数:292
[HackerCup Round1 2] Autocomplete (Trie)
题目链接:https://www.facebook.com/hackercup/problems.php?pid=313229895540583&round=344496159068801题目大意:自己看去(其实我也说不清)裸的Trie树,直接看是否存在必须插入的节点。代码写的太挫了。。将就着看吧。...
分类:其他好文   时间:2015-01-20 15:34:13    阅读次数:144
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!