上一页 1 ··· 8 9 10 11 12 13 14 15 下一页
摘要: Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig... 阅读全文
posted @ 2015-12-14 16:10 ZHOU YANG 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu... 阅读全文
posted @ 2015-12-14 14:31 ZHOU YANG 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the... 阅读全文
posted @ 2015-12-13 19:14 ZHOU YANG 阅读(252) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree andsum =... 阅读全文
posted @ 2015-12-13 17:21 ZHOU YANG 阅读(551) 评论(0) 推荐(0) 编辑
摘要: Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m... 阅读全文
posted @ 2015-12-13 16:35 ZHOU YANG 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Givennballoons, indexed from0ton-1. Each balloon is painted with a number on it represented by arraynums. You are asked to burst all the balloons. If ... 阅读全文
posted @ 2015-12-13 16:12 ZHOU YANG 阅读(449) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.Subscribeto se... 阅读全文
posted @ 2015-12-13 14:42 ZHOU YANG 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to thedefinition of LCA on Wikipedia: “The lowest ... 阅读全文
posted @ 2015-12-12 16:30 ZHOU YANG 阅读(228) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the nthsuper ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime listprimesof s... 阅读全文
posted @ 2015-12-12 15:19 ZHOU YANG 阅读(1283) 评论(0) 推荐(0) 编辑
摘要: Given a range [m, n] where 0 >=1; n>>=1; offset++; } return m<<offset; }}; 阅读全文
posted @ 2015-12-11 16:45 ZHOU YANG 阅读(205) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 下一页