04 2020 档案
摘要:Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree Given a binary tree where each path going from the root to any leaf fo
阅读全文
摘要:First Unique Number You have a queue of integers, you need to retrieve the first unique integer in the queue. Implement the FirstUnique class: FirstUn
阅读全文
摘要:letcode1143 Longest Common Subsequence Longest Common Subsequence Given two strings text1 and text2, return the length of their longest common subsequ
阅读全文
摘要:Leetcode 560 Subarry Sum Equals K Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equ
阅读全文
摘要:leetcode Leftmost Column with at Least a One (This problem is an interactive problem.) A binary matrix means that all elements are 0 or 1. For each in
阅读全文
摘要:Leetcode 1254. Number of Closed Islands Given a 2D grid consists of 0s (land) and 1s (water). An island is a maximal 4 directionally connected group o
阅读全文
摘要:Leetcode 200. Number of Islands Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and
阅读全文
摘要:LeetCode 455. Assign Cookies Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one
阅读全文
摘要:Perform String Shifts You are given a string s containing lowercase English letters, and a matrix shift, where shift[i] = [direction, amount]: directi
阅读全文
摘要:leetcode 494. Target Sum You are given a list of non negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and . For each inte
阅读全文
摘要:leetcode 543. Diameter of Binary Tree Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree i
阅读全文
摘要:leetcode 746. Min Cost Climbing Stairs(easy understanding dp solution) On a staircase, the i th step has some non negative cost cost[i] assigned (0 in
阅读全文
摘要:leetcode 213. House Robber II You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. A
阅读全文
摘要:leetcode 198. House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the
阅读全文
摘要:leetcode 120. Triangle Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. Fo
阅读全文
摘要:leetcode 64. Minimum Path Sum Given a m x n grid filled with non negative numbers, find a path from top left to bottom right which minimizes the sum o
阅读全文
摘要:leetcode 63. Unique Paths II A robot is located at the top left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move
阅读全文
摘要:leetcode 62. Unique Paths A robot is located at the top left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move eit
阅读全文
摘要:Counting Elements Given an integer array arr, count element x such that x + 1 is also in arr. If there're duplicates in arr, count them seperately. Ex
阅读全文
摘要:leetcode 49. Group Anagrams Given an array of strings, group anagrams together. Example: Input: ["eat", "tea", "tan", "ate", "nat", "bat"], Output: [
阅读全文
摘要:leetcode 122. Best Time to Buy and Sell Stock II 相关链接 "leetcode" 描述 Say you have an array for which the ith element is the price of a given stock on d
阅读全文
摘要:leetcode 121. Best Time to Buy and Sell Stock 相关链接 "leetcode" 描述 Say you have an array for which the ith element is the price of a given stock on day
阅读全文
摘要:Table of Contents generated with "DocToc" "ditctaionary and set" "hash 介绍" "集合 set" "创建" "操作和访问集合的元素" "子集、超集、相对判断" "字典 dictionary (map)" "创建字典" "字典的基本
阅读全文
摘要:leetcode 53. Maximum Subarray 链接 "leetcode" 描述 Given an integer array nums, find the contiguous subarray (containing at least one number) which has th
阅读全文
摘要:leetcode 202. Happy Number 相关链接 "LeetCode" 描述 Write an algorithm to determine if a number is "happy". A happy number is a number defined by the follow
阅读全文
摘要:136.Single Number 相关链接 "leetcode" 背景知识 Concept原理 If we take XOR of zero and some bit, it will return that bit a⊕0=a(0异或任何数得任何数) If we take XOR of two
阅读全文
摘要:703. Kth Largest Element in a Stream & c++ priority_queue & minHeap/maxHeap 相关链接 "leetcode" "c++ priority_queue cplusplus" "c++ priority_queue cnblog"
阅读全文