Fork me on GitHub
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 37 下一页
摘要: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you 阅读全文
posted @ 2017-04-06 14:53 hellowOOOrld 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to 阅读全文
posted @ 2017-04-05 17:36 hellowOOOrld 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given numRows, generate the first numRows of Pascal's triangle.For example, given numRows = 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]] 思路: 阅读全文
posted @ 2017-04-04 23:43 hellowOOOrld 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new lengthDo not allocate extra space for 阅读全文
posted @ 2017-04-04 19:02 hellowOOOrld 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3return [1,3,2].Note: Recur 阅读全文
posted @ 2017-04-04 17:34 hellowOOOrld 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals:"Gold Medal", "Silv 阅读全文
posted @ 2017-04-04 15:40 hellowOOOrld 阅读(309) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space. 思路: 判断整数是否为回文数。首先负数不行,举例,假如整数为12345,那么它的反转为54321,与原值不相等,返回false。 假如整数为12321 阅读全文
posted @ 2017-04-03 22:04 hellowOOOrld 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2017-03-31 14:33 hellowOOOrld 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For 阅读全文
posted @ 2017-03-29 21:58 hellowOOOrld 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 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 [ 阅读全文
posted @ 2017-03-29 21:45 hellowOOOrld 阅读(690) 评论(0) 推荐(0) 编辑
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 37 下一页