![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
老胡要顺利毕业
这个作者很懒,什么都没留下…
展开
-
Leetcode刷题记录——867. Transpose Matrix
题目 Given a matrix A, return the transpose of A.The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and column indices of the matrix. Example 1:Inpu...原创 2018-09-23 14:02:03 · 133 阅读 · 0 评论 -
Leetcode刷题记录——590. N-ary Tree Postorder Traversal
题目 Given an n-ary tree, return the postorder traversal of its nodes' values. For example, given a 3-ary tree:Return its postorder traversal as: [5,6,3,2,4,1]. 题目大意&解题思路 这道题的意思...原创 2018-09-22 11:19:25 · 158 阅读 · 0 评论 -
Leetcode刷题记录——700. Search in a Binary Search Tree
题目 Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Return the subtree rooted with that node. If s...原创 2018-09-21 21:03:05 · 619 阅读 · 0 评论 -
Leetcode刷题记录——202. Happy Number
题目 Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the s...原创 2018-09-21 16:15:37 · 152 阅读 · 0 评论 -
Leetcode刷题记录——905. Sort Array By Parity
题目https://leetcode.com/problems/sort-array-by-parity/description/ 题目大意是给你一个数组,将偶数排在奇数前面,返回数组。解题思路 最简单的思路是依次遍历,每当碰到一个奇数,就从之后的数组元素中找出一个偶数,进行遍历,如果找不到,说明该元素之后的元素全是奇数,那么可以直接返回数组,如果找到,则进行交换,然后再遍历下一个元...原创 2018-09-21 10:44:07 · 214 阅读 · 0 评论 -
Leetcode刷题记录——766. Toeplitz Matrix
题目 A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element.Now given an M x N matrix, return True if and only if the matrix is Toeplitz. Example 1:Input:...原创 2018-09-24 18:21:40 · 168 阅读 · 0 评论 -
Leetcode刷题记录——812. Largest Triangle Area
题目 You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points.Example:Input: points = [[0,0],[0,1],[1,0],[0,2],[2,0]]Output: 2...原创 2018-09-24 17:16:03 · 152 阅读 · 0 评论 -
Leetcode刷题记录——598. Range Addition II
题目 Given an m * n matrix M initialized with all 0's and several update operations.Operations are represented by a 2D array, and each operation is represented by an array with two positive integ...原创 2018-09-23 22:37:57 · 133 阅读 · 0 评论 -
Leetcode刷题记录——566. Reshape the Matrix
题目 In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data.You're given a matrix represented by a t...原创 2018-09-23 18:36:19 · 126 阅读 · 0 评论 -
Leetcode刷题记录——832. Flipping an Image
题目 Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image.To flip an image horizontally means that each row of the image is reversed. F...原创 2018-09-23 00:41:25 · 232 阅读 · 0 评论