6 两鬓已不能斑白
尚未进行身份认证
现就职于小米
897. Increasing Order Search TreeGiven a tree, rearrange the tree in in-order so that the leftmost node in the tree is now the root of the tree, and every node has no left child and only 1 right chil...
942. DI String Match下班到家后,刷了刷leetcode,发现了一道很有意思的小题,题目如下:Given a string S that only contains “I” (increase) or “D” (decrease), let N = S.length.Return any permutation A of [0, 1, …, N] such that fo...
1、Two Sumhttps://blog.csdn.net/u010429424/article/details/7764898927、Remove Elementhttps://blog.csdn.net/u010429424/article/details/7326056453、Maximum Subarrayhttps://blog.csdn.net/u010429424/art...
因为平时工作中较少能接触到HashMap的排序,因此周末借由一道leetcode上的小题,再写一写HashMap的排序代码,特此记录。原题如下:Top K Frequent WordsGiven a non-empty list of words, return the k most frequent elements.Your answer should be sorted by f...
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.Example 1:Input: [3,2,1,5,6,4] and k = 2Output: 5Exampl...
Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack.Example 1:...
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example 1:Input: 2Output...
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.Your KthLargest class will have a constructor whi...
Java Exception、Error学习一、Exception(异常)、Error(错误)均继承自Throwable,表示可以被抛出,需要使用catch捕获。IOException:I/O操作异常,一般在文件读写时捕获ClassNotFoundException:找不到指定类的异常(编译时Class.forName)TimeoutException:超时异常,Exception th...
yolo3+python识别二维码中的汉字源码下载地址https://github.com/lijialinneu/keras-yolo3-master/准备环境(1)python环境,安装anaconda3,我装的是python3.6版本(2)安装tensorflow(cpu版)、keras,直接用pipinstall命令下载,或condainstall命令(3)下载...
leetcode 广搜小题两道周末无聊,故刷两道小题,用的都是广搜的思想Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node ...
Given a Binary Search Tree (BST) with the root node root, return the minimum difference between the values of any two different nodes in the tree.Example :Input: root = [4,2,6,1,3,null,null...
最近在刷Leetcode中,遇到两道SQL小题,记录在此 join小例子: 181. Employees Earning More Than Their Managers 197. Rising Temperature left join 小例子: 175. Combine Two Tables181. Employees Earning More...
You are given a data structure of employee information, which includes the employee’s unique id, his importance value and his direct subordinates’ id. For example, employee 1 is the leader of employ...
**888. Fair Candy Swap**Alice and Bob have candy bars of different sizes: A[i] is the size of the i-th bar of candy that Alice has, and B[j] is the size of the j-th bar of candy that Bob has.Since...
Given an n-ary tree, return the preorder traversal of its nodes’ values.For example, given a 3-ary tree:Return its preorder traversal as: [1,3,5,6,2,4].Note: Recursive solution is trivial, cou...
Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surro...
A website domain like “discuss.leetcode.com” consists of various subdomains. At the top level, we have “com”, at the next level, we have “leetcode.com”, and at the lowest level, “discuss.leetcode.com”...
Given a string S and a character C, return an array of integers representing the shortest distance from the character C in the string.Example 1:Input: S = "loveleetcode", C = 'e'Output: [3...
Let’s call an array A a mountain if the following properties hold: A.length >= 3 There exists some 0 < i < A.length - 1 such that A[0] < A[1] < ... A[i-1] < A[i] ...