在springboot 容器启动时,我们需要在启动过程中做一些操作,比如启动容器后,执行某些代码。 spring 提供了监听器,我们可以方便的实现这些操作。 在容器启动开始时: 在容器启动完成后执行操作: 如果需要有顺序执行,我们可以实现Ordered接口,只越小,越先执行。 ...
分类:
编程语言 时间:
2018-10-14 22:02:40
阅读次数:
183
Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest le ...
分类:
其他好文 时间:
2018-10-14 20:53:01
阅读次数:
102
Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo ...
分类:
其他好文 时间:
2018-10-14 13:52:33
阅读次数:
122
https://leetcode.com/problems/longest-valid-parentheses/description/ 来回做了好几遍,虽然AC 了但是这个解发肯定不是最优的。思路是把问题分两步解决:1. 把字符串转换成一个匹配括号的id 序列,比如第0 个和第3 个匹配了,则把0 ...
分类:
其他好文 时间:
2018-10-12 16:07:49
阅读次数:
106
1 import java.util.Scanner; 2 3 /** 4 * Created by qmq 5 * Given a string, find the length of the longest substring without repeating characters. 6 * ... ...
分类:
其他好文 时间:
2018-10-12 11:57:22
阅读次数:
166
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe ...
分类:
其他好文 时间:
2018-10-11 13:41:53
阅读次数:
156
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Example 1: Exampl ...
分类:
其他好文 时间:
2018-10-11 01:35:51
阅读次数:
147
Longest Substring Without Repeating Characters(最长的子串不重复字符) 题目要求:给定一个字符串,找到最长的子字符串的长度,要求不重复字符。 例如: 给定一个字符串“abcabcbb”,答案是“abc”,长度是3。 给定一个字符串“bbbbb”,答案是“ ...
分类:
其他好文 时间:
2018-10-10 22:02:26
阅读次数:
176
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l ...
分类:
其他好文 时间:
2018-10-09 21:36:02
阅读次数:
138
一、最长公共子序列介绍 一个序列的子序列是在该序列中删去若干元素后得到的序列。例如:“ABCD”和“BDF”都是“ABCDEFG”的子序列。 最长公共子序列(Longest Common Subsequence,简写LCS)问题:给定两个序列X和Y,求X和Y长度最大的公共子序列。例如:X=“ABBC ...
分类:
其他好文 时间:
2018-10-09 18:11:30
阅读次数:
213