码迷,mamicode.com
首页 >  
搜索关键字:two pointers    ( 12138个结果
[leetcode]Populating Next Right Pointers in Each Node @ Python
原题地址:https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/题意: 1 / \ 2 3 / \ / \ 4 5 6 7变为: ...
分类:编程语言   时间:2014-05-26 23:43:29    阅读次数:332
【题解】【数组】【Leetcode】Median of Two Sorted Arrays
####Median of Two Sorted Arrays >There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overa...
分类:其他好文   时间:2014-05-26 23:13:41    阅读次数:265
模拟括号
Let S = s1 s2...s2n be a well-formed string of parentheses. S can be encoded in two different ways:q By an integer sequence P = p1 p2...pn where pi is...
分类:其他好文   时间:2014-05-26 22:07:33    阅读次数:300
002. 斐波那契数列中的偶数
Problem 2: Even Fibonacci numbers Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:             1, 2,...
分类:其他好文   时间:2014-05-22 23:29:44    阅读次数:435
欧拉项目004:寻找最大的回文数
Problem 4: Largest palindrome product A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest pal...
分类:其他好文   时间:2014-05-22 18:48:46    阅读次数:355
Same Tree
Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an...
分类:其他好文   时间:2014-05-22 16:46:03    阅读次数:173
从两个TIMESTAMP中获取时间差(秒)
When you subtract two variables of type TIMESTAMP, you get an INTERVAL DAY TO SECOND which includes a number of milliseconds and/or microseconds depending on the platform. If the database is running o...
分类:其他好文   时间:2014-05-21 15:36:38    阅读次数:488
LeetCode: Count and Say [037]
【题目】 The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read off as "one 2, then one 1" or 1211. Given an integer n, generate...
分类:其他好文   时间:2014-05-21 15:20:07    阅读次数:213
LeetCode: Multiply Strings [042]
【题目】 Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 【题意】 给定用字符串表示的整数,返回两个数的乘积结果字符串。两个数字都非负,且能任意大。 【思路】 1. 考虑其中一个数是0的情况 2. 模拟乘法运算...
分类:其他好文   时间:2014-05-21 13:45:37    阅读次数:214
LeetCode:Two Sum
题目:       Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up t...
分类:其他好文   时间:2014-05-21 07:42:18    阅读次数:230
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!