leetcode
silent56_th
大学生一枚,对机器学习、图像处理感兴趣,偶尔也会刷刷leetcode或者hihocoder。希望在这里可以和大家多多交流,互相学习。
展开
-
[leetcode 406]Queue Reconstruction by Height
问题描述Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of th原创 2017-03-02 19:27:17 · 432 阅读 · 0 评论 -
[leetcode 515]Find Largest Value in Each Tree Row
问题描述You need to find the largest value in each row of a binary tree.Example: Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9]代码深搜而已。 int cal_depth(TreeNode* root) {原创 2017-03-03 13:37:07 · 494 阅读 · 0 评论 -
[leetcode 442] Find All Duplicates in an Array
问题描述Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it without extra s原创 2017-03-03 14:12:07 · 495 阅读 · 0 评论 -
[leetcode 508]Most Frequent Subtree Sum
问题描述Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (incl原创 2017-03-04 14:47:42 · 306 阅读 · 0 评论 -
[leetocde 151]Reverse Words in a String
问题描述Given an input string, reverse the string word by word.For example, Given s = “the sky is blue”, return “blue is sky the”.Update (2015-02-12): For C programmers: Try to solve it in-place in O(1)原创 2017-03-04 15:13:03 · 359 阅读 · 0 评论