数组
leetcode-数组分类
小啊小木头
能学以致用是这世间最幸福的事。
展开
-
[leetcode刷题] [Easy] [Array] 977. 有序数组的平方(Squares of a Sorted Array)- Java
题目: Squares of a Sorted Array英文: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.Example 1:Input: [-4,-1,0,3,10]Output: [0,1,9,16,100]Example 2:Input: [-原创 2020-11-25 02:44:18 · 216 阅读 · 0 评论 -
[leetcode刷题] [Easy] [Array] 1295. 统计位数为偶数的数字(Find Numbers with Even Number of Digits)- Java
题目: Find Numbers with Even Number of Digits英文:Given an array nums of integers, return how many of them contain an even number of digits.Example 1:Input: nums = [12,345,2,6,7896]Output: 2Explanation: 12 contains 2 digits (even number of digits). 345原创 2020-11-22 22:26:26 · 182 阅读 · 0 评论 -
[leetcode刷题] [Easy] [Array] 485.最大连续1的个数(Max Consecutive Ones)- Java
题目: Max Consecutive OnesGiven a binary array, find the maximum number of consecutive 1s in this array.给定一个二进制数组,求出该数组中连续1的最大个数。Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are consecutive 1s. T原创 2020-11-22 21:47:28 · 203 阅读 · 0 评论