随笔分类 - Array
数组、极值
[Leetcode 452] 最少需要射出多少支箭Minimum Number of Arrows to Burst Balloons 贪心 重载
摘要:【题目】 There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of th
阅读全文
[Leetcode 18]四数之和 4 Sum
摘要:【题目】 Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all uni
阅读全文
[Leetcode 46]全排列 Permutations 递归
摘要:【题目】 Given a collection of distinct integers, return all possible permutations. 数组的组合情况。 【思路】 求子集,排列组合的数组题有固定模板。 【代码】
阅读全文
[Leetcode 90]求含有重复数的子集 Subset II
摘要:【题目】 Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not
阅读全文
[Leetcode 78]求子集 Subset
摘要:【题目】 Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. 求
阅读全文
[Leetcode 15]三数之和 3 Sum
摘要:【题目】 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives
阅读全文
[leetcode121]股票买卖 Best Time to Buy and Sell Kadane算法
摘要:【题目】 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transa
阅读全文
浙公网安备 33010602011771号