摘要:
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2016-09-22 09:18
Machelsky
阅读(140)
评论(0)
推荐(0)
摘要:
There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a certai 阅读全文
posted @ 2016-09-22 08:40
Machelsky
阅读(536)
评论(0)
推荐(0)
摘要:
There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacent 阅读全文
posted @ 2016-09-22 08:14
Machelsky
阅读(136)
评论(0)
推荐(0)
摘要:
Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w 阅读全文
posted @ 2016-09-22 06:54
Machelsky
阅读(187)
评论(0)
推荐(0)
摘要:
Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w 阅读全文
posted @ 2016-09-22 06:20
Machelsky
阅读(169)
评论(0)
推荐(0)
摘要:
Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up 阅读全文
posted @ 2016-09-22 05:34
Machelsky
阅读(119)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2016-09-22 05:10
Machelsky
阅读(107)
评论(0)
推荐(0)
摘要:
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t 阅读全文
posted @ 2016-09-22 04:47
Machelsky
阅读(135)
评论(0)
推荐(0)
摘要:
Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2, 阅读全文
posted @ 2016-09-22 04:34
Machelsky
阅读(116)
评论(0)
推荐(0)
摘要:
Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2016-09-22 04:15
Machelsky
阅读(121)
评论(0)
推荐(0)
摘要:
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the or 阅读全文
posted @ 2016-09-22 03:55
Machelsky
阅读(133)
评论(0)
推荐(0)
摘要:
非常好的总结 REF:https://discuss.leetcode.com/topic/50315/a-summary-how-to-use-bit-manipulation-to-solve-problems-easily-and-efficiently 阅读全文
posted @ 2016-09-22 03:04
Machelsky
阅读(94)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2016-09-22 02:56
Machelsky
阅读(127)
评论(0)
推荐(0)