随笔分类 - LeetCode
摘要:Max Number of K-Sum Pairs (M) 题目 You are given an integer array nums and an integer k. In one operation, you can pick two numbers from the array whose
阅读全文
摘要:Kth Largest Element in an Array (M) 题目 Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order,
阅读全文
摘要:Get Maximum in Generated Array (E) 题目 You are given an integer n. An array nums of length n + 1 is generated in the following way: nums[0] = 0 nums[1]
阅读全文
摘要:Minimum Operations to Reduce X to Zero (M) 题目 You are given an integer array nums and an integer x. In one operation, you can either remove the leftmo
阅读全文
摘要:Boats to Save People (M) 题目 The i-th person has weight people[i], and each boat can carry a maximum weight of limit. Each boat carries at most 2 peopl
阅读全文
摘要:Merge Sorted Array (E) 题目 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements in
阅读全文
摘要:Create Sorted Array through Instructions (H) 题目 Given an integer array instructions, you are asked to create a sorted array from the elements in instr
阅读全文
摘要:Word Ladder (H) 题目 Given two words beginWord and endWord, and a dictionary wordList, return the length of the shortest transformation sequence from be
阅读全文
摘要:Check If Two String Arrays are Equivalent (E) 题目 Given two string arrays word1 and word2, return true if the two arrays represent the same string, and
阅读全文
摘要:Kth Missing Positive Number (E) 题目 Given an array arr of positive integers sorted in a strictly increasing order, and an integer k. Find the kth posit
阅读全文
摘要:Remove Duplicates from Sorted List II (M) 题目 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers f
阅读全文
摘要:Beautiful Arrangement (M) 题目 Suppose you have n integers from 1 to n. We define a beautiful arrangement as an array that is constructed by these n num
阅读全文
摘要:Find a Corresponding Node of a Binary Tree in a Clone of That Tree (M) 题目 Given two binary trees original and cloned and given a reference to a node t
阅读全文
摘要:Check Array Formation Through Concatenation (E) 题目 You are given an array of distinct integers arr and an array of integer arrays pieces, where the in
阅读全文
摘要:Largest Rectangle in Histogram (H) 题目 Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the
阅读全文
摘要:Pseudo-Palindromic Paths in a Binary Tree (M) 题目 Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be
阅读全文
摘要:Reach a Number (M) 题目 You are standing at position 0 on an infinite number line. There is a goal at position target. On each move, you can either go l
阅读全文
摘要:Jump Game IV (H) 题目 Given an array of integers arr, you are initially positioned at the first index of the array. In one step you can jump from index
阅读全文
摘要:Decode Ways (M) 题目 A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Give
阅读全文
摘要:Diagonal Traverse (M) 题目 Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in the bel
阅读全文

浙公网安备 33010602011771号