12 2020 档案

摘要: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 阅读全文
posted @ 2020-12-31 22:03 墨云黑 阅读(74) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-29 19:54 墨云黑 阅读(109) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-29 13:57 墨云黑 阅读(74) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-27 19:43 墨云黑 阅读(204) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-26 16:57 墨云黑 阅读(63) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-25 22:31 墨云黑 阅读(67) 评论(0) 推荐(0)
摘要:Next Greater Element III (M) 题目 Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integer n and 阅读全文
posted @ 2020-12-23 17:19 墨云黑 阅读(68) 评论(0) 推荐(0)
摘要:Balanced Binary Tree (E) 题目 Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a 阅读全文
posted @ 2020-12-22 17:13 墨云黑 阅读(40) 评论(0) 推荐(0)
摘要:Smallest Range II (M) 题目 Given an array A of integers, for each integer A[i] we need to choose either x = -K or x = K, and add x to A[i] (only once). 阅读全文
posted @ 2020-12-21 20:32 墨云黑 阅读(106) 评论(0) 推荐(0)
摘要:Decoded String at Index (M) 题目 An encoded string S is given. To find and write the decoded string to a tape, the encoded string is read one character 阅读全文
posted @ 2020-12-20 20:00 墨云黑 阅读(188) 评论(0) 推荐(0)
摘要:Cherry Pickup II (H) 题目 Given a rows x cols matrix grid representing a field of cherries. Each cell in grid represents the number of cherries that you 阅读全文
posted @ 2020-12-20 09:55 墨云黑 阅读(217) 评论(0) 推荐(0)
摘要:4Sum II (M) 题目 Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is ze 阅读全文
posted @ 2020-12-17 16:36 墨云黑 阅读(141) 评论(0) 推荐(0)
摘要:Validate Binary Search Tree (M) 题目 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The l 阅读全文
posted @ 2020-12-16 16:51 墨云黑 阅读(117) 评论(0) 推荐(0)
摘要:Squares of a Sorted Array (E) 题目 Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in n 阅读全文
posted @ 2020-12-15 16:50 墨云黑 阅读(134) 评论(0) 推荐(0)
摘要:Palindrome Partitioning (M) 题目 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrom 阅读全文
posted @ 2020-12-14 16:53 墨云黑 阅读(100) 评论(0) 推荐(0)
摘要:Smallest Subtree with all the Deepest Nodes (M) 题目 Given the root of a binary tree, the depth of each node is the shortest distance to the root. Retur 阅读全文
posted @ 2020-12-12 17:08 墨云黑 阅读(146) 评论(0) 推荐(0)
摘要:Remove Duplicates from Sorted Array II (M) 题目 Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice an 阅读全文
posted @ 2020-12-11 18:09 墨云黑 阅读(101) 评论(0) 推荐(0)
摘要:Valid Mountain Array (E) 题目 Given an array of integers arr, return true if and only if it is a valid mountain array. Recall that arr is a mountain arr 阅读全文
posted @ 2020-12-10 16:57 墨云黑 阅读(124) 评论(0) 推荐(0)
摘要:Binary Search Tree Iterator (M) 题目 Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BS 阅读全文
posted @ 2020-12-09 19:13 墨云黑 阅读(78) 评论(0) 推荐(0)
摘要:Pairs of Songs With Total Durations Divisible by 60 (M) 题目 You are given a list of songs where the ith song has a duration of time[i] seconds. Return 阅读全文
posted @ 2020-12-08 17:49 墨云黑 阅读(159) 评论(0) 推荐(0)
摘要:Populating Next Right Pointers in Each Node II (M) 题目 Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each 阅读全文
posted @ 2020-12-06 17:03 墨云黑 阅读(120) 评论(0) 推荐(0)
摘要:Can Place Flowers (E) 题目 You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adj 阅读全文
posted @ 2020-12-05 22:22 墨云黑 阅读(113) 评论(0) 推荐(0)
摘要:The kth Factor of n (M) 题目 Given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0. Consider a list 阅读全文
posted @ 2020-12-04 22:22 墨云黑 阅读(207) 评论(0) 推荐(0)
摘要:Increasing Order Search Tree (M) 题目 Given the root of a binary search tree, rearrange the tree in in-order so that the leftmost node in the tree is no 阅读全文
posted @ 2020-12-03 17:41 墨云黑 阅读(142) 评论(0) 推荐(0)
摘要:Linked List Random Node (M) 题目 Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability 阅读全文
posted @ 2020-12-02 21:44 墨云黑 阅读(176) 评论(0) 推荐(0)
摘要:Maximum Depth of Binary Tree (E) 题目 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from 阅读全文
posted @ 2020-12-01 16:27 墨云黑 阅读(95) 评论(0) 推荐(0)