Quantcast
Channel: 书影 - Entries for the tag leetcode
Browsing all 559 articles
Browse latest View live

[LeetCode]Increasing Subsequences

题目描述:LeetCode 491. Increasing SubsequencesGiven an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence...

View Article


LeetCode Weekly Contest 16A解题报告

LeetCode Weekly Contest 16A是LeetCode举办的第十九场正式周赛,共3道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-16a/题解列表:LeetCode 484. Find PermutationLeetCode 494. Target sumLeetCode 491....

View Article


[LeetCode]Construct the rectangle

题目描述:LeetCode 492. Construct the rectangleFor a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to...

View Article

[LeetCode]Predict the Winner

题目描述:LeetCode 486. Predict the WinnerGiven an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1...

View Article

[LeetCode]Smallest Good Base

题目描述:LeetCode 483. Smallest Good BaseFor an integer n, we call k>=2 a good base of n, if all digits of n base k are 1.Now given a string representing n, you should return the smallest good base of n...

View Article


LeetCode Weekly Contest 16B解题报告

LeetCode Weekly Contest 16B是LeetCode举办的第二十场正式周赛,共3道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-16b/题解列表:LeetCode 492. Construct the rectangleLeetCode 486. Predict the...

View Article

[LeetCode]Find Mode in Binary Tree

题目描述:LeetCode 501. Find Mode in Binary TreeGiven a binary tree with duplicates. You have to find all the mode(s) in given binary tree.For example: Given binary tree [1,null,2,2], 1 \ 2 / 2return...

View Article

[LeetCode]Teemo Attacking

题目描述:LeetCode 495. Teemo AttackingIn LLP world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascending time series...

View Article


Image may be NSFW.
Clik here to view.

[LeetCode]The Maze II

题目描述:LeetCode 499. The Maze IIThere is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up (u), down (d), left (l) or right (r), but it won't stop rolling...

View Article


LeetCode Weekly Contest 17解题报告

LeetCode Weekly Contest 17是LeetCode举办的第二十一场正式周赛,共3道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-17/题解列表:LeetCode 501. Find Mode in Binary TreeLeetCode 495. Teemo...

View Article

Image may be NSFW.
Clik here to view.

[LeetCode]Keyboard Row

题目描述:LeetCode 500. Keyboard RowGiven a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.Example 1:Input: ["Hello",...

View Article

[LeetCode]Most Frequent Subtree Sum

题目描述:LeetCode 508. Most Frequent Subtree SumGiven the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed...

View Article

[LeetCode]IPO

题目描述:LeetCode 502. IPOSuppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects to increase its capital...

View Article


LeetCode Weekly Contest 18a解题报告

LeetCode Weekly Contest 18a是LeetCode举办的第二十二场正式周赛,共3道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-18a/题解列表:LeetCode 500. Keyboard RowLeetCode 508. Most Frequent Subtree...

View Article

[LeetCode]Next Greater Element I

题目描述:LeetCode 496. Next Greater Element IYou are given two arrays (without duplicates)nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements...

View Article


[LeetCode]Relative Ranks

题目描述:LeetCode 506. Relative RanksGiven scores of N athletes, find their relative ranks and the men with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and...

View Article

[LeetCode]Next Greater Element II

题目描述:LeetCode 503. Next Greater Element IIGiven a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The Next...

View Article


Image may be NSFW.
Clik here to view.

[LeetCode]Diagonal Traverse

题目描述:LeetCode 498. Diagonal TraverseGiven a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order.Example 1:Input: [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]...

View Article

LeetCode Weekly Contest 18b解题报告

LeetCode Weekly Contest 18b是LeetCode举办的第二十三场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-18b/题解列表:LeetCode 496. Next Greater Element ILeetCode 506. Relative...

View Article

[LeetCode]Base 7

题目描述:LeetCode 504. Base 7Given an integer, return its base 7 string representation.Example 1:Input: 100Output:"202"Example 2:Input: -7Output:"-10"Note: The input will be in range of [-1e7,...

View Article
Browsing all 559 articles
Browse latest View live