摘要: Given an array of integers nums, you start with an initial positive value startValue. In each iteration, you calculate the step by step sum of startVa 阅读全文
posted @ 2020-06-29 19:55 whatyouthink 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers arr, a lucky integer is an integer which has a frequency in the array equal to its value. Return a lucky integer in the arr 阅读全文
posted @ 2020-06-29 19:40 whatyouthink 阅读(49) 评论(0) 推荐(0) 编辑
摘要: Given an integer n. Each number from 1 to n is grouped according to the sum of its digits. Return how many groups have the largest size. 对1-n的数分组,分组规则 阅读全文
posted @ 2020-06-29 19:36 whatyouthink 阅读(65) 评论(0) 推荐(0) 编辑
摘要: Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements. Return a list of pairs i 阅读全文
posted @ 2020-06-29 17:18 whatyouthink 阅读(54) 评论(0) 推荐(0) 编辑
摘要: On an 8 x 8 chessboard, there is one white rook. There also may be empty squares, white bishops, and black pawns. These are given as characters 'R', ' 阅读全文
posted @ 2020-06-29 17:11 whatyouthink 阅读(88) 评论(0) 推荐(0) 编辑
摘要: The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding one 阅读全文
posted @ 2020-06-29 16:42 whatyouthink 阅读(83) 评论(0) 推荐(0) 编辑
摘要: You are given an array of strings words and a string chars. A string is good if it can be formed by characters from chars (each character can only be 阅读全文
posted @ 2020-06-29 16:18 whatyouthink 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. Sort the elements of arr1 such that the 阅读全文
posted @ 2020-06-29 16:09 whatyouthink 阅读(97) 评论(0) 推荐(0) 编辑
摘要: Given an array A of strings made only from lowercase letters, return a list of all characters that show up in all strings within the list (including d 阅读全文
posted @ 2020-06-29 15:50 whatyouthink 阅读(43) 评论(0) 推荐(0) 编辑
摘要: Given two integer arrays arr1 and arr2, and the integer d, return the distance value between the two arrays. The distance value is defined as the numb 阅读全文
posted @ 2020-06-29 15:31 whatyouthink 阅读(108) 评论(0) 推荐(0) 编辑
摘要: Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes of the k weakest rows in the matrix or 阅读全文
posted @ 2020-06-29 14:57 whatyouthink 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(53) 评论(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 阅读(74) 评论(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 阅读(66) 评论(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 阅读(80) 评论(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 阅读(35) 评论(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 阅读(63) 评论(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 阅读(67) 评论(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 阅读(31) 评论(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 阅读(25) 评论(0) 推荐(0) 编辑