随笔分类 -  LeetCode

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页
摘要:Add Two Numbers II (M) 题目 You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and 阅读全文
posted @ 2020-11-07 20:06 墨云黑 阅读(128) 评论(0) 推荐(0)
摘要:Find the Smallest Divisor Given a Threshold (M) 题目 Given an array of integers nums and an integer threshold, we will choose a positive integer divisor 阅读全文
posted @ 2020-11-06 19:25 墨云黑 阅读(188) 评论(0) 推荐(0)
摘要:Minimum Cost to Move Chips to The Same Position (E) 题目 We have n chips, where the position of the ith chip is position[i]. We need to move all the chi 阅读全文
posted @ 2020-11-05 16:42 墨云黑 阅读(233) 评论(0) 推荐(0)
摘要:Minimum Height Trees (M) 题目 A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected g 阅读全文
posted @ 2020-11-04 23:47 墨云黑 阅读(112) 评论(0) 推荐(0)
摘要:Consecutive Characters (E) 题目 Given a string s, the power of the string is the maximum length of a non-empty substring that contains only one unique c 阅读全文
posted @ 2020-11-03 19:23 墨云黑 阅读(140) 评论(0) 推荐(0)
摘要:Insertion Sort List (M) 题目 Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initially c 阅读全文
posted @ 2020-11-02 16:01 墨云黑 阅读(148) 评论(0) 推荐(0)
摘要:Convert Binary Number in a Linked List to Integer (E) 题目 Given head which is a reference node to a singly-linked list. The value of each node in the l 阅读全文
posted @ 2020-11-01 15:34 墨云黑 阅读(124) 评论(0) 推荐(0)
摘要:Recover Binary Search Tree (H) 题目 You are given the root of a binary search tree (BST), where exactly two nodes of the tree were swapped by mistake. R 阅读全文
posted @ 2020-11-01 15:26 墨云黑 阅读(89) 评论(0) 推荐(0)
摘要:Number of Longest Increasing Subsequence (M) 题目 Given an integer array nums, return the number of longest increasing subsequences. Example 1: Input: n 阅读全文
posted @ 2020-10-30 21:40 墨云黑 阅读(119) 评论(0) 推荐(0)
摘要:Maximize Distance to Closest Person (M) 题目 You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the it 阅读全文
posted @ 2020-10-29 20:26 墨云黑 阅读(149) 评论(0) 推荐(0)
摘要:Summary Ranges (M) 题目 Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Input: [0,1,2,4,5,7] Output: ["0-> 阅读全文
posted @ 2020-10-28 15:24 墨云黑 阅读(127) 评论(0) 推荐(0)
摘要:Linked List Cycle II (M) 题目 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in th 阅读全文
posted @ 2020-10-27 21:41 墨云黑 阅读(98) 评论(0) 推荐(0)
摘要:Champagne Tower (M) 题目 We stack glasses in a pyramid, where the first row has 1 glass, the second row has 2 glasses, and so on until the 100th row. Ea 阅读全文
posted @ 2020-10-27 09:14 墨云黑 阅读(131) 评论(0) 推荐(0)
摘要:Stone Game IV (H) 题目 Alice and Bob take turns playing a game, with Alice starting first. Initially, there are n stones in a pile. On each player's tur 阅读全文
posted @ 2020-10-25 22:52 墨云黑 阅读(200) 评论(0) 推荐(0)
摘要:Bag of Tokens (M) 题目 You have an initial power of P, an initial score of 0, and a bag of tokens where tokens[i] is the value of the ith token (0-index 阅读全文
posted @ 2020-10-25 11:00 墨云黑 阅读(137) 评论(0) 推荐(0)
摘要:Minimum Depth of Binary Tree (E) 题目 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from 阅读全文
posted @ 2020-10-22 15:48 墨云黑 阅读(94) 评论(0) 推荐(0)
摘要:Asteroid Collision (M) 题目 We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represent 阅读全文
posted @ 2020-10-22 10:40 墨云黑 阅读(131) 评论(0) 推荐(0)
摘要:Clone Graph (M) 题目 Given a reference of a node in a connected undirected graph. Return a deep copy (clone) of the graph. Each node in the graph contai 阅读全文
posted @ 2020-10-20 19:53 墨云黑 阅读(104) 评论(0) 推荐(0)
摘要:Best Time to Buy and Sell Stock IV (H) 题目 You are given an integer array prices where prices[i] is the price of a given stock on the ith day. Design a 阅读全文
posted @ 2020-10-18 21:28 墨云黑 阅读(111) 评论(0) 推荐(0)
摘要:Search a 2D Matrix (M) 题目 Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integer 阅读全文
posted @ 2020-10-16 16:00 墨云黑 阅读(188) 评论(0) 推荐(0)

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页