摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
posted @ 2020-08-08 10:56 little_veggie 阅读(65) 评论(0) 推荐(0)
摘要: Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1, 阅读全文
posted @ 2020-08-08 07:27 little_veggie 阅读(59) 评论(0) 推荐(0)
摘要: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Inpu 阅读全文
posted @ 2020-08-07 11:58 little_veggie 阅读(55) 评论(0) 推荐(0)
摘要: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2020-08-07 03:55 little_veggie 阅读(70) 评论(0) 推荐(0)
摘要: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Exampl 阅读全文
posted @ 2020-08-06 15:13 little_veggie 阅读(133) 评论(0) 推荐(0)
摘要: Given a string, find the length of the longest substring T that contains at most k distinct characters. Example 1: Input: s = "eceba", k = 2 Output: 3 阅读全文
posted @ 2020-08-06 07:35 little_veggie 阅读(82) 评论(0) 推荐(0)
摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example: Input: S = "ADOB 阅读全文
posted @ 2020-08-06 04:14 little_veggie 阅读(121) 评论(0) 推荐(0)
摘要: 知识点,题型,模板,易错点,刷题中碰到的有用的小撇步小巧思还有语法问题都统一汇总在这里 String s.subtr(pos) pos to end or s.substr(pos, len) repeating a single char multiple times: string(times, 阅读全文
posted @ 2020-08-05 16:14 little_veggie 阅读(82) 评论(0) 推荐(0)
摘要: Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Example: Input: 阅读全文
posted @ 2020-08-05 14:39 little_veggie 阅读(77) 评论(0) 推荐(0)
摘要: You are given a string s containing lowercase English letters, and a matrix shift, where shift[i] = [direction, amount]: direction can be 0 (for left 阅读全文
posted @ 2020-08-05 12:13 little_veggie 阅读(173) 评论(0) 推荐(0)