
LeetCode
文章平均质量分 66
珍妮的选择
这个作者很懒,什么都没留下…
展开
-
461. Hamming Distance*(汉明距离)
461. Hamming Distance*(汉明距离)https://leetcode.com/problems/hamming-distance/题目描述The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, return the Hamming distance be原创 2021-04-22 21:33:14 · 457 阅读 · 0 评论 -
200. Number of Islands**(岛屿数量)
200. Number of Islands**(岛屿数量)https://leetcode.com/problems/number-of-islands/题目描述Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the number of islands.An island is surrounded by water and is formed by原创 2021-04-22 09:21:12 · 372 阅读 · 0 评论 -
796. Rotate String* (旋转字符串)
796. Rotate String* (旋转字符串)https://leetcode.com/problems/rotate-string/题目描述We are given two strings, A and B.A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will原创 2021-03-21 22:52:42 · 364 阅读 · 0 评论 -
944. Delete Columns to Make Sorted*
944. Delete Columns to Make Sorted*https://leetcode.com/problems/delete-columns-to-make-sorted/题目描述We are given an array A of N lowercase letter strings, all of the same length.Now, we may choose ...原创 2020-04-17 23:10:32 · 337 阅读 · 0 评论 -
1403. Minimum Subsequence in Non-Increasing Order*
1403. Minimum Subsequence in Non-Increasing Order*https://leetcode.com/problems/minimum-subsequence-in-non-increasing-order/题目描述Given the array nums, obtain a subsequence of the array whose sum of ...原创 2020-04-17 00:17:21 · 589 阅读 · 0 评论 -
1374. Generate a String With Characters That Have Odd Counts*
1374. Generate a String With Characters That Have Odd Counts*https://leetcode.com/problems/generate-a-string-with-characters-that-have-odd-counts/题目描述Given an integer n, return a string with n char...原创 2020-04-01 09:11:56 · 483 阅读 · 0 评论 -
1338. Reduce Array Size to The Half**
1338. Reduce Array Size to The Half**https://leetcode.com/problems/reduce-array-size-to-the-half/题目描述Given an array arr. You can choose a set of integers and remove all the occurrences of these in...原创 2020-04-01 08:42:39 · 777 阅读 · 0 评论 -
1389. Create Target Array in the Given Order*
1389. Create Target Array in the Given Order*https://leetcode.com/problems/create-target-array-in-the-given-order/题目描述Given two arrays of integers nums and index. Your task is to create target arra...原创 2020-03-31 21:40:31 · 690 阅读 · 0 评论 -
1313. Decompress Run-Length Encoded List*
1313. Decompress Run-Length Encoded List*https://leetcode.com/problems/decompress-run-length-encoded-list/题目描述We are given a list nums of integers representing a list compressed with run-length enc...原创 2020-03-31 21:18:03 · 395 阅读 · 0 评论 -
1288. Remove Covered Intervals**
1288. Remove Covered Intervals**https://leetcode.com/problems/remove-covered-intervals/题目描述Given a list of intervals, remove all intervals that are covered by another interval in the list. Interval...原创 2020-03-31 09:01:00 · 641 阅读 · 0 评论 -
739. Daily Temperatures**
739. Daily Temperatures**https://leetcode.com/problems/daily-temperatures/题目描述Given a list of daily temperatures T, return a list such that, for each day in the input, tells you how many days you w...原创 2020-03-31 08:15:28 · 317 阅读 · 0 评论 -
912. Sort an Array**
912. Sort an Array**https://leetcode.com/problems/sort-an-array/题目描述Given an array of integers nums, sort the array in ascending order.Example 1:Input: nums = [5,2,3,1]Output: [1,2,3,5]Example...原创 2020-03-30 08:08:19 · 277 阅读 · 0 评论 -
1342. Number of Steps to Reduce a Number to Zero*
1342. Number of Steps to Reduce a Number to Zero*https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/题目描述Given a non-negative integer num, return the number of steps to reduce ...原创 2020-03-30 07:34:17 · 400 阅读 · 0 评论 -
623. Add One Row to Tree**
623. Add One Row to Tree**https://leetcode.com/problems/add-one-row-to-tree/题目描述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 d...原创 2020-03-30 07:29:28 · 344 阅读 · 0 评论 -
951. Flip Equivalent Binary Trees**
951. Flip Equivalent Binary Trees**https://leetcode.com/problems/flip-equivalent-binary-trees/题目描述For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left ...原创 2020-03-29 09:25:23 · 255 阅读 · 0 评论 -
861. Score After Flipping Matrix**
861. Score After Flipping Matrix**https://leetcode.com/problems/score-after-flipping-matrix/题目描述We have a two dimensional matrix A where each value is 0 or 1.A move consists of choosing any row or...原创 2020-03-29 08:58:35 · 274 阅读 · 0 评论 -
986. Interval List Intersections**
986. Interval List Intersections**https://leetcode.com/problems/interval-list-intersections/题目描述Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order....原创 2020-03-29 08:49:18 · 290 阅读 · 0 评论 -
1161. Maximum Level Sum of a Binary Tree**
1161. Maximum Level Sum of a Binary Tree**https://leetcode.com/problems/maximum-level-sum-of-a-binary-tree/题目描述Given the root of a binary tree, the level of its root is 1, the level of its children...原创 2020-03-28 22:33:51 · 304 阅读 · 0 评论 -
921. Minimum Add to Make Parentheses Valid**
921. Minimum Add to Make Parentheses Valid**https://leetcode.com/problems/minimum-add-to-make-parentheses-valid/题目描述Given a string S of '(' and ')' parentheses, we add the minimum number of parenth...原创 2020-03-28 22:10:18 · 259 阅读 · 0 评论 -
338. Counting Bits**
338. Counting Bits**https://leetcode.com/problems/counting-bits/题目描述Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary...原创 2020-03-27 08:51:28 · 285 阅读 · 0 评论 -
191. Number of 1 Bits*
191. Number of 1 Bits*https://leetcode.com/problems/number-of-1-bits/题目描述Write a function that takes an unsigned integer and return the number of ‘1’ bits it has (also known as the Hamming weight)....原创 2020-03-27 08:50:32 · 338 阅读 · 0 评论 -
198. House Robber*
198. House Robber*https://leetcode.com/problems/house-robber/题目描述You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only cons...原创 2020-03-26 23:47:26 · 255 阅读 · 0 评论 -
797. All Paths From Source to Target**
797. All Paths From Source to Target**https://leetcode.com/problems/all-paths-from-source-to-target/题目描述Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1,...原创 2020-03-26 08:14:37 · 296 阅读 · 0 评论 -
763. Partition Labels**
763. Partition Labels**https://leetcode.com/problems/partition-labels/题目描述A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each lett...原创 2020-03-25 23:14:11 · 249 阅读 · 0 评论 -
1382. Balance a Binary Search Tree**
1382. Balance a Binary Search Tree**https://leetcode.com/problems/balance-a-binary-search-tree/题目描述Given a binary search tree, return a balanced binary search tree with the same node values.A bina...原创 2020-03-25 13:12:31 · 536 阅读 · 0 评论 -
1038. Binary Search Tree to Greater Sum Tree**
1038. Binary Search Tree to Greater Sum Tree**https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/题目描述Given the root of a binary search tree with distinct values, modify it so that...原创 2020-03-25 12:55:52 · 308 阅读 · 0 评论 -
1282. Group the People Given the Group Size They Belong To**
1282. Group the People Given the Group Size They Belong To**https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to/题目描述There are n people whose IDs go from 0 to n - 1 an...原创 2020-03-25 09:23:31 · 457 阅读 · 0 评论 -
70. Climbing Stairs*
70. Climbing Stairs*https://leetcode.com/problems/climbing-stairs/题目描述You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many d...原创 2020-03-25 08:13:18 · 280 阅读 · 0 评论 -
1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree**
1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree**https://leetcode.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/题目描述Given two binary trees...原创 2020-03-25 08:04:46 · 624 阅读 · 0 评论 -
1137. N-th Tribonacci Number*
1137. N-th Tribonacci Number*https://leetcode.com/problems/n-th-tribonacci-number/题目描述The Tribonacci sequence Tn is defined as follows:T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >...原创 2020-03-24 23:14:57 · 353 阅读 · 0 评论 -
172. Factorial Trailing Zeroes*
172. Factorial Trailing Zeroes*https://leetcode.com/problems/factorial-trailing-zeroes/题目描述Given an integer n, return the number of trailing zeroes in n!.Example 1:Input: 3Output: 0Explanation:...原创 2020-03-24 09:15:03 · 235 阅读 · 0 评论 -
300. Longest Increasing Subsequence**
300. Longest Increasing Subsequence**https://leetcode.com/problems/longest-increasing-subsequence/题目描述Given an unsorted array of integers, find the length of longest increasing subsequence.Example...原创 2020-03-24 09:00:27 · 271 阅读 · 0 评论 -
278. First Bad Version*
278. First Bad Version*https://leetcode.com/problems/first-bad-version/题目描述You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your...原创 2020-03-23 23:17:08 · 266 阅读 · 0 评论 -
367. Valid Perfect Square*
367. Valid Perfect Square*https://leetcode.com/problems/valid-perfect-square/题目描述Given a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do no...原创 2020-03-23 19:54:01 · 306 阅读 · 0 评论 -
374. Guess Number Higher or Lower*
374. Guess Number Higher or Lower*https://leetcode.com/problems/guess-number-higher-or-lower/题目描述We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to gues...原创 2020-03-23 12:40:30 · 315 阅读 · 0 评论 -
744. Find Smallest Letter Greater Than Target*
744. Find Smallest Letter Greater Than Target*https://leetcode.com/problems/find-smallest-letter-greater-than-target/题目描述Given a list of sorted characters letters containing only lowercase letters,...原创 2020-03-23 12:23:17 · 235 阅读 · 0 评论 -
392. Is Subsequence*
392. Is Subsequence*https://leetcode.com/problems/is-subsequence/题目描述Given a string s and a string t, check if s is subsequence of t.You may assume that there is only lower case English letters in...原创 2020-03-23 07:33:44 · 258 阅读 · 0 评论 -
704. Binary Search*
704. Binary Search*https://leetcode.com/problems/binary-search/题目描述Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums...原创 2020-03-23 07:12:50 · 271 阅读 · 0 评论 -
1337. The K Weakest Rows in a Matrix*
1337. The K Weakest Rows in a Matrix*https://leetcode.com/problems/the-k-weakest-rows-in-a-matrix/题目描述Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), re...原创 2020-03-22 09:52:07 · 411 阅读 · 0 评论 -
852. Peak Index in a Mountain Array*
852. Peak Index in a Mountain Array*https://leetcode.com/problems/peak-index-in-a-mountain-array/题目描述Let’s call an array A a mountain if the following properties hold:A.length >= 3There exist...原创 2020-03-22 09:00:06 · 251 阅读 · 0 评论