02 2021 档案

摘要:Maximum Frequency Stack (H) 题目 Implement FreqStack, a class which simulates the operation of a stack-like data structure. FreqStack has two functions: 阅读全文
posted @ 2021-02-28 16:59 墨云黑 阅读(83) 评论(0) 推荐(0)
摘要:Validate Stack Sequences (M) 题目 Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result 阅读全文
posted @ 2021-02-26 22:48 墨云黑 阅读(67) 评论(0) 推荐(0)
摘要:Shortest Unsorted Continuous Subarray (M) 题目 Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray 阅读全文
posted @ 2021-02-25 16:37 墨云黑 阅读(69) 评论(0) 推荐(0)
摘要:Score of Parentheses (M) 题目 Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has 阅读全文
posted @ 2021-02-24 17:50 墨云黑 阅读(54) 评论(0) 推荐(0)
摘要:Search a 2D Matrix II (M) 题目 Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Inte 阅读全文
posted @ 2021-02-23 16:24 墨云黑 阅读(52) 评论(0) 推荐(0)
摘要:Longest Word in Dictionary through Deleting (M) 题目 Given a string and a string dictionary, find the longest string in the dictionary that can be forme 阅读全文
posted @ 2021-02-22 20:16 墨云黑 阅读(56) 评论(0) 推荐(0)
摘要:Broken Calculator (M) 题目 On a broken calculator that has a number showing on its display, we can perform two operations: Double: Multiply the number o 阅读全文
posted @ 2021-02-21 22:40 墨云黑 阅读(56) 评论(0) 推荐(0)
摘要:Minimum Remove to Make Valid Parentheses (M) 题目 Given a string s of '(' , ')' and lowercase English characters. Your task is to remove the minimum num 阅读全文
posted @ 2021-02-19 17:35 墨云黑 阅读(54) 评论(0) 推荐(0)
摘要:Arithmetic Slices (M) 题目 A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two co 阅读全文
posted @ 2021-02-18 17:45 墨云黑 阅读(70) 评论(0) 推荐(0)
摘要:Letter Case Permutation (M) 题目 Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Ret 阅读全文
posted @ 2021-02-16 20:21 墨云黑 阅读(70) 评论(0) 推荐(0)
摘要:The K Weakest Rows in a Matrix (E) 题目 Given a m * n matrix mat of ones (representing soldiers) and zeros (representing civilians), return the indexes 阅读全文
posted @ 2021-02-15 19:34 墨云黑 阅读(57) 评论(0) 推荐(0)
摘要:Is Graph Bipartite? (M) 题目 Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split its 阅读全文
posted @ 2021-02-14 21:27 墨云黑 阅读(128) 评论(0) 推荐(0)
摘要:Shortest Path in Binary Matrix (M) 题目 In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-rig 阅读全文
posted @ 2021-02-13 16:32 墨云黑 阅读(108) 评论(0) 推荐(0)
摘要:Number of Steps to Reduce a Number to Zero (E) 题目 Given a non-negative integer num, return the number of steps to reduce it to zero. If the current nu 阅读全文
posted @ 2021-02-12 16:05 墨云黑 阅读(78) 评论(0) 推荐(0)
摘要:Valid Anagram (E) 题目 Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = "anagram", t = "nagaram" 阅读全文
posted @ 2021-02-11 21:50 墨云黑 阅读(63) 评论(0) 推荐(0)
摘要:Copy List with Random Pointer (M) 题目 A linked list is given such that each node contains an additional random pointer which could point to any node in 阅读全文
posted @ 2021-02-10 17:05 墨云黑 阅读(71) 评论(0) 推荐(0)
摘要:Convert BST to Greater Tree (M) 题目 Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST 阅读全文
posted @ 2021-02-09 16:44 墨云黑 阅读(61) 评论(0) 推荐(0)
摘要:Shortest Distance to a Character (E) 题目 Given a string s and a character c that occurs in s, return an array of integers answer where answer.length == 阅读全文
posted @ 2021-02-07 16:39 墨云黑 阅读(61) 评论(0) 推荐(0)
摘要:Binary Tree Right Side View (M) 题目 Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see 阅读全文
posted @ 2021-02-06 16:36 墨云黑 阅读(47) 评论(0) 推荐(0)
摘要:Simplify Path (M) 题目 Given a string path, which is an absolute path (starting with a slash '/') to a file or directory in a Unix-style file system, co 阅读全文
posted @ 2021-02-05 19:11 墨云黑 阅读(74) 评论(0) 推荐(0)
摘要:Longest Harmonious Subsequence (E) 题目 We define a harmonious array as an array where the difference between its maximum value and its minimum value is 阅读全文
posted @ 2021-02-04 19:10 墨云黑 阅读(64) 评论(0) 推荐(0)
摘要:Linked List Cycle (E) 题目 Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos 阅读全文
posted @ 2021-02-03 19:39 墨云黑 阅读(48) 评论(0) 推荐(0)
摘要:Trim a Binary Search Tree (M) 题目 Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that a 阅读全文
posted @ 2021-02-02 17:18 墨云黑 阅读(52) 评论(0) 推荐(0)
摘要:Number of 1 Bits (E) 题目 Write a function that takes an unsigned integer and return the number of '1' bits it has (also known as the Hamming weight). E 阅读全文
posted @ 2021-02-01 17:10 墨云黑 阅读(79) 评论(0) 推荐(0)