摘要: 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 @ 2013-12-15 22:35 海滨银枪小霸王 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2013-12-15 21:58 海滨银枪小霸王 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文
posted @ 2013-12-15 19:32 海滨银枪小霸王 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given a number represented as an array of digits, plus one to the number.class Solution {public: vector plusOne(vector &digits) { int len... 阅读全文
posted @ 2013-12-15 12:01 海滨银枪小霸王 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... 阅读全文
posted @ 2013-12-15 11:30 海滨银枪小霸王 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp... 阅读全文
posted @ 2013-12-15 09:01 海滨银枪小霸王 阅读(107) 评论(0) 推荐(0) 编辑