6 两鬓已不能斑白

尚未进行身份认证

现就职于小米

等级
TA的排名 2k+

897. Increasing Order Search Tree

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...

2019-03-27 23:26:40

942. DI String Match

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...

2019-03-26 22:38:39

LeetCode刷题笔记目录

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...

2019-03-01 22:59:39

692. Top K Frequent Words:HashMap排序

因为平时工作中较少能接触到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...

2019-01-06 11:23:48

Leetcode 215. Kth Largest Element in an Array

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...

2018-12-31 00:27:07

Leetcode 946. Validate Stack Sequences

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:...

2018-12-23 16:14:50

338. Counting Bits

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...

2018-11-11 17:32:36

Leetcode 703.Kth Largest Element in a Stream

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...

2018-11-03 22:52:13

Java Exception、Error学习

Java Exception、Error学习一、Exception(异常)、Error(错误)均继承自Throwable,表示可以被抛出,需要使用catch捕获。IOException:I/O操作异常,一般在文件读写时捕获ClassNotFoundException:找不到指定类的异常(编译时Class.forName)TimeoutException:超时异常,Exception th...

2018-10-28 15:37:00

yolo3 + python 找出图像中的汉字

yolo3+python识别二维码中的汉字源码下载地址https://github.com/lijialinneu/keras-yolo3-master/准备环境(1)python环境,安装anaconda3,我装的是python3.6版本(2)安装tensorflow(cpu版)、keras,直接用pipinstall命令下载,或condainstall命令(3)下载...

2018-10-21 09:34:25

leetcode 广搜小题两道

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 ...

2018-09-22 23:49:43

783. Minimum Distance Between BST Nodes

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...

2018-09-09 09:13:58

SQL join、left join小例子

最近在刷Leetcode中,遇到两道SQL小题,记录在此 join小例子: 181. Employees Earning More Than Their Managers 197. Rising Temperature left join 小例子: 175. Combine Two Tables181. Employees Earning More...

2018-09-09 08:27:33

690. Employee Importance

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...

2018-09-08 23:35:06

888. Fair Candy Swap

**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...

2018-08-25 10:56:36

Leetcode 关于树的题:589. N-ary Tree Preorder Traversal 和 429. N-ary Tree Level Order Traversal

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...

2018-08-25 09:30:26

695. Max Area of Island

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...

2018-06-28 21:32:33

811. Subdomain Visit Count

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”...

2018-06-27 21:18:54

821. Shortest Distance to a Character

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...

2018-06-22 09:46:10

852. Peak Index in a Mountain Array

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] ...

2018-06-18 11:03:15

查看更多

勋章 我的勋章
  • 专栏达人
    专栏达人
    授予成功创建个人博客专栏的用户。专栏中添加五篇以上博文即可点亮!撰写博客专栏浓缩技术精华,专栏达人就是你!