xinyu04

导航

2022年9月15日 #

LeetCode 452 Minimum Number of Arrows to Burst Balloons

摘要: There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer array points where 阅读全文

posted @ 2022-09-15 20:40 Blackzxy 阅读(20) 评论(0) 推荐(0) 编辑

LeetCode 1588 Sum of All Odd Length Subarrays 前缀和

摘要: Given an array of positive integers arr, return the sum of all possible odd-length subarrays of arr. A subarray is a contiguous subsequence of the arr 阅读全文

posted @ 2022-09-15 17:22 Blackzxy 阅读(9) 评论(0) 推荐(0) 编辑

LeetCode 1151 Minimum Swaps to Group All 1's Together 滑动窗口

摘要: Given a binary array data, return the minimum number of swaps required to group all 1’s present in the array together in any place in the array. Solut 阅读全文

posted @ 2022-09-15 04:22 Blackzxy 阅读(10) 评论(0) 推荐(0) 编辑

LeetCode 325 Maximum Size Subarray Sum Equals k 贪心+Map

摘要: Given an integer array nums and an integer k, return the maximum length of a subarray that sums to k. If there is not one, return 0 instead. Solution 阅读全文

posted @ 2022-09-15 03:44 Blackzxy 阅读(13) 评论(0) 推荐(0) 编辑

LeetCode 1901 Find a Peak Element II 二分

摘要: A peak element in a 2D grid is an element that is strictly greater than all of its adjacent neighbors to the left, right, top, and bottom. Given a $0$ 阅读全文

posted @ 2022-09-15 02:07 Blackzxy 阅读(15) 评论(0) 推荐(0) 编辑