08 2020 档案

摘要:A string S of lowercase English letters is given. We want to partition this string into as many parts as possible so that each letter appears in at mo 阅读全文
posted @ 2020-08-24 08:54 little_veggie 阅读(171) 评论(0) 推荐(0)
摘要:Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num 阅读全文
posted @ 2020-08-22 07:01 little_veggie 阅读(105) 评论(0) 推荐(0)
摘要:You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each log is an alphanumeric identifier. Then 阅读全文
posted @ 2020-08-20 07:39 little_veggie 阅读(108) 评论(0) 推荐(0)
摘要:There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access the next r 阅读全文
posted @ 2020-08-19 11:27 little_veggie 阅读(205) 评论(0) 推荐(0)
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Given a non-empty strin 阅读全文
posted @ 2020-08-18 04:55 little_veggie 阅读(176) 评论(0) 推荐(0)
摘要:Given a binary tree, return the inorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Recursive so 阅读全文
posted @ 2020-08-15 13:53 little_veggie 阅读(78) 评论(0) 推荐(0)
摘要:Given a binary tree, return the postorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [3,2,1] Follow up: Recursive 阅读全文
posted @ 2020-08-15 05:38 little_veggie 阅读(93) 评论(0) 推荐(0)
摘要:Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3] Follow up: Recursive s 阅读全文
posted @ 2020-08-15 05:02 little_veggie 阅读(109) 评论(0) 推荐(0)
摘要:Given a sentence text (A sentence is a string of space-separated words) in the following format: First letter is in upper case. Each word in text are 阅读全文
posted @ 2020-08-14 08:01 little_veggie 阅读(187) 评论(0) 推荐(0)
摘要:1. 高效运输 输入:产品i有boxes[i]箱, 每箱装unitsPerBox[i]个,卡车最多装truckSize箱 输出:一车能运的max units Greedy, 用map扫一遍。 2. 快乐字母异位词 输入:a list of strings 输出:如果cur是之前某个str的anagr 阅读全文
posted @ 2020-08-14 06:16 little_veggie 阅读(200) 评论(0) 推荐(0)
摘要:Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle. Note that the row index starts from 0. In Pascal's trian 阅读全文
posted @ 2020-08-13 05:01 little_veggie 阅读(74) 评论(0) 推荐(0)
摘要:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). F 阅读全文
posted @ 2020-08-13 03:14 little_veggie 阅读(84) 评论(0) 推荐(0)
摘要:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). F 阅读全文
posted @ 2020-08-13 02:44 little_veggie 阅读(120) 评论(0) 推荐(0)
摘要:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). Y 阅读全文
posted @ 2020-08-12 14:49 little_veggie 阅读(97) 评论(0) 推荐(0)
摘要:Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Y 阅读全文
posted @ 2020-08-12 14:00 little_veggie 阅读(101) 评论(0) 推荐(0)
摘要:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l 阅读全文
posted @ 2020-08-12 10:04 little_veggie 阅读(119) 评论(0) 推荐(0)
摘要:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist 阅读全文
posted @ 2020-08-12 05:31 little_veggie 阅读(94) 评论(0) 推荐(0)
摘要:A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are give 阅读全文
posted @ 2020-08-11 03:51 little_veggie 阅读(85) 评论(0) 推荐(0)
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文
posted @ 2020-08-10 13:13 little_veggie 阅读(157) 评论(0) 推荐(0)
摘要:Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. 阅读全文
posted @ 2020-08-09 11:54 little_veggie 阅读(89) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2020-08-09 05:29 little_veggie 阅读(99) 评论(0) 推荐(0)
摘要:Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the 阅读全文
posted @ 2020-08-09 04:44 little_veggie 阅读(104) 评论(0) 推荐(0)
摘要: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 阅读(68) 评论(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 阅读(69) 评论(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 阅读(66) 评论(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 阅读(79) 评论(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 阅读(137) 评论(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 阅读(89) 评论(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 阅读(123) 评论(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 阅读(89) 评论(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 阅读(82) 评论(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 阅读(182) 评论(0) 推荐(0)
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 阅读全文
posted @ 2020-08-05 05:22 little_veggie 阅读(84) 评论(0) 推荐(0)
摘要:Given an array of strings, group anagrams together. Example: Input: ["eat", "tea", "tan", "ate", "nat", "bat"], Output: [ ["ate","eat","tea"], ["nat", 阅读全文
posted @ 2020-08-05 03:37 little_veggie 阅读(196) 评论(0) 推荐(0)
摘要:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文
posted @ 2020-08-04 12:07 little_veggie 阅读(100) 评论(0) 推荐(0)
摘要:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2020-08-04 11:19 little_veggie 阅读(87) 评论(0) 推荐(0)
摘要:Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you would have to wait until a warme 阅读全文
posted @ 2020-08-04 10:38 little_veggie 阅读(107) 评论(0) 推荐(0)
摘要:Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only 阅读全文
posted @ 2020-08-04 09:40 little_veggie 阅读(91) 评论(0) 推荐(0)