- 博客(7)
- 收藏
- 关注
原创 leetcode:the skyline problem
class Solution { public: struct node { int x, heightIndex; bool leftOrRight; node(int _x, int _heightIndex, bool _leftOrRight):x(_x), heightIndex(_heightIndex), leftOrR
2015-07-31 23:21:41 416
原创 leetcode:Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity.class Solution { public: int trailingZeroes(int n) { int c
2015-07-15 22:46:07 340
原创 leetcode:Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a
2015-07-15 21:37:05 446
原创 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 to the target, w
2015-07-12 22:45:29 437
原创 leecode:combinations
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and k = 2, a solution is: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4
2015-07-11 23:52:18 358
原创 maximum-depth-of-binary-tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. /** * Definition for binary tre
2015-07-02 16:39:20 390
原创 single-number
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using e
2015-07-02 10:41:41 343
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人