摘要:
快排 int partition(vector<int>& nums, int start, int end) { int tmp = nums[start]; int i = start, j = end; while (i < j) { while (i < j && nums[j] >= tm 阅读全文
摘要:
3. Longest Substring Without Repeating Characters 187. Repeated DNA Sequences 209. Minimum Size Subarray Sum 438. Find All Anagrams in a String 1438. 阅读全文
摘要:
原题链接 1658. Minimum Operations to Reduce X to Zero 题目描述 给你一个整数数组 nums 和一个整数 x 。每一次操作时,你应当移除数组 nums 最左边或最右边的元素,然后从 x 中减去该元素的值。请注意,需要 修改 数组以供接下来的操作使用。 如果 阅读全文
摘要:
原题链接 474. Ones and Zeroes 题目描述 给你一个二进制字符串数组 strs 和两个整数 m 和 n 。 请你找出并返回 strs 的最大子集的大小,该子集中 最多 有 m 个 0 和 n 个 1 。 如果 x 的所有元素也是 y 的元素,集合 x 是集合 y 的 子集 。 示例 阅读全文