上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even. Sort the array so that whenever A[i]  阅读全文
posted @ 2020-06-29 14:44 whatyouthink 阅读(57) 评论(0) 推荐(0)
摘要: Students are asked to stand in non-decreasing order of heights for an annual photo. Return the minimum number of students that must move in order for 阅读全文
posted @ 2020-06-29 14:34 whatyouthink 阅读(80) 评论(0) 推荐(0)
摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2020-06-29 14:13 whatyouthink 阅读(71) 评论(0) 推荐(0)
摘要: Given a m * n matrix of distinct numbers, return all lucky numbers in the matrix in any order. A lucky number is an element of the matrix such that it 阅读全文
posted @ 2020-06-29 14:07 whatyouthink 阅读(83) 评论(0) 推荐(0)
摘要: Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. nlog做 阅读全文
posted @ 2020-06-29 13:36 whatyouthink 阅读(40) 评论(0) 推荐(0)
摘要: Given an array of unique integers salary where salary[i] is the salary of the employee i. Return the average salary of employees excluding the minimum 阅读全文
posted @ 2020-06-29 13:11 whatyouthink 阅读(70) 评论(0) 推荐(0)
摘要: Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A. You may re 阅读全文
posted @ 2020-06-29 12:52 whatyouthink 阅读(71) 评论(0) 推荐(0)
摘要: Given two integer arrays of equal length target and arr. In one step, you can select any non-empty sub-array of arr and reverse it. You are allowed to 阅读全文
posted @ 2020-06-29 12:48 whatyouthink 阅读(37) 评论(0) 推荐(0)
摘要: 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 t 阅读全文
posted @ 2020-06-29 12:42 whatyouthink 阅读(30) 评论(0) 推荐(0)
摘要: Given an integer n, return any array containing n unique integers such that they add up to 0. 分奇偶吧,偶就给i和-i,奇的话就最后多给个0 class Solution(object): def sumZ 阅读全文
posted @ 2020-06-29 12:36 whatyouthink 阅读(23) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 下一页