- 博客(5)
- 收藏
- 关注
原创 LeetCode 之 Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3].Note: Recursive soluti
2016-01-22 14:45:59 364
原创 LeetCode 之 Missing Number
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm sho
2016-01-21 11:55:15 199
原创 LeetCode 之 Bulb Switcher
There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning off
2016-01-19 21:39:15 243
原创 LeetCode 之 Product of Array Except Self
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O
2016-01-14 22:47:37 219
原创 LeetCode 之 Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on
2016-01-14 22:01:12 257
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人