随笔分类 - LeetCode
摘要:You are given an integer array . From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called odd
阅读全文
摘要:Given an array of integers, return the number of (contiguous, non empty) subarrays that have a sum divisible by . Example 1: Note: 1. `1 这道题给了一个数组,让返回
阅读全文
摘要:We have a list of on the plane. Find the closest points to the origin . (Here, the distance between two points on a plane is the Euclidean distance.)
阅读全文
摘要:Given two strings and , each of which represents a non negative rational number, return True if and only if they represent the same number. The string
阅读全文
摘要:You are given the root of a binary tree with n nodes, where each node is uniquely assigned a value from 1 to n. You are also given a sequence of n val
阅读全文
摘要:Given two positive integers and , an integer is powerful if it is equal to for some integers and . Return a list of all powerful integers that have va
阅读全文
摘要:Given an array of integers , sort the array by performing a series of pancake flips. In one pancake flip we do the following steps: Choose an integer
阅读全文
摘要:Given a binary tree, we install cameras on the nodes of the tree. Each camera at a node can monitor its parent, itself, and its immediate children. Ca
阅读全文
摘要:Return all non negative integers of length such that the absolute difference between every two consecutive digits is . Note that every number in the a
阅读全文
摘要:Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word. For a given query word, the spell checker handle
阅读全文
摘要:Given the root of a binary tree, calculate the vertical order traversal of the binary tree. For each node at position (row, col), its left and right c
阅读全文
摘要:A binary tree is univalued if every node in the tree has the same value. Return if and only if the given tree is univalued. Example 1: Example 2: Note
阅读全文
摘要:Given a single positive integer , we will write an expression of the form where each operator , , etc. is either addition, subtraction, multiplication
阅读全文
摘要:Given a set of points in the xy plane, determine the minimum area of any rectangle formed from these points, with sides not necessarily parallel to th
阅读全文
摘要:Given an array of integers, a ramp is a tuple for which `i 这道题说给了一个数组A,这里定义了一种叫做 Ramp 的范围 (i, j),满足 `i Github 同步地址: 参考资料: "LeetCode All in One 题目讲解汇总(
阅读全文
摘要:In a array of size , there are unique elements, and exactly one of these elements is repeated times. Return the element repeated times. Example 1: Exa
阅读全文
摘要:We are given an array A of N lowercase letter strings, all of the same length. Now, we may choose any set of deletion indices, and for each string, we
阅读全文
摘要:In a N x N grid composed of 1 x 1 squares, each 1 x 1 square consists of a /, \, or blank space. These characters divide the square into contiguous re
阅读全文
摘要:Given a binary tree, determine if it is a complete binary tree. Definition of a complete binary tree from Wikipedia: In a complete binary tree every l
阅读全文
摘要:There are 8 prison cells in a row, and each cell is either occupied or vacant. Each day, whether the cell is occupied or vacant changes according to t
阅读全文