随笔分类 - LeetCode
摘要:Serialize and Deserialize Binary Tree (H) 题目 Serialization is the process of converting a data structure or object into a sequence of bits so that it
阅读全文
摘要:Binary Tree Maximum Path Sum (H) 题目 A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge conne
阅读全文
摘要:Maximum Units on a Truck (E) 题目 You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where boxTypes[i] = [n
阅读全文
摘要:My Calendar I (M) 题目 Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking.
阅读全文
摘要:Construct Binary Tree from Preorder and Inorder Traversal (M) 题目 Given preorder and inorder traversal of a tree, construct the binary tree. Note: You
阅读全文
摘要:Min Cost Climbing Stairs (E) 题目 You are given an integer array cost where cost[i] is the cost of ith step on a staircase. Once you pay the cost, you c
阅读全文
摘要:Longest Consecutive Sequence (M) 题目 Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must
阅读全文
摘要:Open the Lock (M) 题目 You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
阅读全文
摘要:Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts (M) 题目 Given a rectangular cake with height h and width w, and two arrays of intege
阅读全文
摘要:Interleaving String (M) 题目 Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2. An interleaving of two strings s a
阅读全文
摘要:Max Area of Island (M) 题目 You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizo
阅读全文
摘要:Search Suggestions System (M) 题目 Given an array of strings products and a string searchWord. We want to design a system that suggests at most three pr
阅读全文
摘要:Maximum Erasure Value (M) 题目 You are given an array of positive integers nums and want to erase a subarray containing unique elements. The score you g
阅读全文
摘要:Maximum Product of Word Lengths (M) 题目 Given a string array words, return the maximum value of length(word[i]) * length(word[j]) where the two words d
阅读全文
摘要:Partitioning Into Minimum Number Of Deci-Binary Numbers (M) 题目 A decimal number is called deci-binary if each of its digits is either 0 or 1 without a
阅读全文
摘要:Evaluate Reverse Polish Notation (M) 题目 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Eac
阅读全文
摘要:To Lower Case (E) 题目 Given a string s, return the string after replacing every uppercase letter with the same lowercase letter. Example 1: Input: s =
阅读全文
摘要:Find and Replace Pattern (M) 题目 Given a list of strings words and a string pattern, return a list of words[i] that match pattern. You may return the a
阅读全文
摘要:0102. Binary Tree Level Order Traversal (M) 题目 Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, le
阅读全文
摘要:Minimum Moves to Equal Array Elements II (M) 题目 Given an integer array nums of size n, return the minimum number of moves required to make all array e
阅读全文

浙公网安备 33010602011771号