随笔分类 - LeetCode
摘要:Russian Doll Envelopes (H) 题目 You are given a 2D array of integers envelopes where envelopes[i] = [wi, hi] represents the width and the height of an e
阅读全文
摘要:Flip Binary Tree To Match Preorder Traversal (M) 题目 You are given the root of a binary tree with n nodes, where each node is uniquely assigned a value
阅读全文
摘要:Reconstruct Original Digits from English (M) 题目 Given a non-empty string containing an out-of-order English representation of digits 0-9, output the d
阅读全文
摘要:Palindromic Substrings (M) 题目 Given a string, your task is to count how many palindromic substrings in this string. The substrings with different star
阅读全文
摘要:Word Subsets (M) 题目 We are given two arrays A and B of words. Each word is a string of lowercase letters. Now, say that word b is a subset of word a i
阅读全文
摘要:Wiggle Subsequence (M) 题目 Given an integer array nums, return the length of the longest wiggle sequence. A wiggle sequence is a sequence where the dif
阅读全文
摘要:Pacific Atlantic Water Flow (M) 题目 Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacif
阅读全文
摘要:Advantage Shuffle (M) 题目 Given two arrays A and B of equal size, the advantage of A with respect to B is the number of indices i for which A[i] > B[i]
阅读全文
摘要:3Sum With Multiplicity (M) 题目 Given an integer array arr, and an integer target, return the number of tuples i, j, k such that i < j < k and arr[i] +
阅读全文
摘要:Vowel Spellchecker (M) 题目 Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word. For a given query word
阅读全文
摘要:Reordered Power of 2 (M) 题目 Starting with a positive integer N, we reorder the digits in any order (including the original order) such that the leadin
阅读全文
摘要:Design Underground System (M) 题目 Implement the class UndergroundSystem that supports three methods: 1. checkIn(int id, string stationName, int t) A cu
阅读全文
摘要:Keys and Rooms (M) 题目 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 key
阅读全文
摘要:Generate Random Point in a Circle (M) 题目 Given the radius and x-y positions of the center of a circle, write a function randPoint which generates a un
阅读全文
摘要:Best Time to Buy and Sell Stock with Transaction Fee (M) 题目 You are given an array prices where prices[i] is the price of a given stock on the ith day
阅读全文
摘要:Encode and Decode TinyURL (M) 题目 Note: This is a companion problem to the System Design problem: Design TinyURL. TinyURL is a URL shortening service w
阅读全文
摘要:Swapping Nodes in a Linked List (M) 题目 You are given the head of a linked list, and an integer k. Return the head of the linked list after swapping th
阅读全文
摘要:Binary Trees With Factors (M) 题目 Given an array of unique integers, arr, where each integer arr[i] is strictly greater than 1. We make a binary tree u
阅读全文
摘要:Check If a String Contains All Binary Codes of Size K (M) 题目 Given a binary string s and an integer k. Return True if every binary code of length k is
阅读全文
摘要:Add One Row to Tree (M) 题目 Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d
阅读全文

浙公网安备 33010602011771号