05 2020 档案
摘要:There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have direct prerequisites, for example, to take course 0 you
阅读全文
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree. Example Given in-o
阅读全文
摘要:Return the lexicographically smallest subsequence of text that contains all the distinct characters of text exactly once. Example 1: Input: "cdadabcc"
阅读全文
摘要:Given many words, words[i] has weight i. Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will ret
阅读全文
摘要:Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks. Tasks coul
阅读全文
摘要:Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: [0,1] Output: 2 Explanation: [0
阅读全文
摘要:Given an array of integers and a number k, the majority number is the number that occurs more than 1/k of the size of the array, find all the majority
阅读全文
摘要:Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1) spa
阅读全文
摘要:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the
阅读全文
摘要:Problem Link: Multiple of 2019 Key idea: For subarray S[i1, j] and S[i2, j] with i1 < i2, if the V[i1, j] % 2019 is the same with V[i2, k] % 2019, it
阅读全文
摘要:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
阅读全文
摘要:There are n people and 40 types of hats labeled from 1 to 40. Given a list of list of integers hats, where hats[i] is a list of all hats preferred by
阅读全文
摘要:You are given an m * n matrix, mat, and an integer k, which has its rows sorted in non-decreasing order. You are allowed to choose exactly 1 element f
阅读全文
摘要:Given an array of n integer with duplicate number, and a moving window(size k), move the window at each iteration from the start of the array, find th
阅读全文

浙公网安备 33010602011771号