07 2014 档案

摘要:Binary Tree Level Order Traversal IIGiven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level... 阅读全文
posted @ 2014-07-14 20:47 陆草纯 阅读(6921) 评论(0) 推荐(0) 编辑
摘要:Distinct SubsequencesGiven a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is... 阅读全文
posted @ 2014-07-10 20:05 陆草纯 阅读(4293) 评论(1) 推荐(0) 编辑
摘要:Search Insert PositionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if ... 阅读全文
posted @ 2014-07-09 21:21 陆草纯 阅读(293) 评论(1) 推荐(0) 编辑
摘要:3SumGiven an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:El... 阅读全文
posted @ 2014-07-08 19:38 陆草纯 阅读(4534) 评论(0) 推荐(0) 编辑
摘要:int转string(注:itoa不是标准函数,OJ平台可能不接受)int n = 10;char temp[32];string str; sprintf(temp, "%d", n);str = temp;orstring str = to_string(n);注意:to_string(int ... 阅读全文
posted @ 2014-07-08 11:08 陆草纯 阅读(291) 评论(0) 推荐(0) 编辑
摘要:Sudoku SolverWrite a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character'.'.You may assume that the... 阅读全文
posted @ 2014-07-06 18:45 陆草纯 阅读(7418) 评论(3) 推荐(1) 编辑
摘要:Max Points on a LineGivennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.点和方向确定一条直线。需要两重循环,第一重循环遍历起始点a,第二重... 阅读全文
posted @ 2014-07-04 20:41 陆草纯 阅读(2018) 评论(1) 推荐(1) 编辑

点击右上角即可分享
微信分享提示