![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
文章平均质量分 59
「已注销」
这个作者很懒,什么都没留下…
展开
-
1480. Running Sum of 1d Array 一维数组的动态和
Problem Leetcode Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example Input: nums = [1,2,3,4] Output: [1,3,6,10] Explanation: Running sum is obtained as follows: [1, 1+2,原创 2021-01-19 21:40:50 · 89 阅读 · 0 评论 -
【Leetcode】 1232. Check If It Is a Straight Line 缀点成线
Problem Leetcode You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane. Example Example1 Input: coordinates = [[1,2],[2,3],[3,4],[4,5],[5,原创 2021-01-17 14:41:41 · 95 阅读 · 0 评论 -
【Leetcode】 面试题 17.10. Find Majority Element LCCI 主要元素
Problem Leetcode A majority element is an element that makes up more than half of the items in an array. Given a positive integers array, find the majority element. If there is no majority element, return -1. Do this in O(N) time and O(1) space. Example Ex原创 2021-01-16 16:54:59 · 125 阅读 · 0 评论 -
【Leetcode】 867. Transpose Matrix 转置矩阵
Problem Leetcode 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 Example1: Input: [[1,2,3],[4,5,6],[7,8,9]] Output: [[1,4,7],原创 2021-01-16 15:26:01 · 89 阅读 · 0 评论