原创 Angular中的FormControl

需求:郵箱驗證、密碼驗證、用戶名驗證、IP地址驗證、手機號驗證等 方案: 1、鍵值的形式控制: this.formGroup = new FormGroup({ username: new FormControl('', [Validat

原创 [leetcode]-523-Continuous Subarray Sum

題目: Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuou

原创 [leetcode]-525. Contiguous Array

題目: Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: In

原创 Leetcode-backtracking題目總結

Leetcode-78. Subsets  (全組合問題) Given a set of distinct integers, nums, return all possible subsets (the power set). Note

原创 [leetcode]-30-Substring with Concatenation of All Words

題目: You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices o

原创 Spring開發-Bean

1、Bean的定義 In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC cont

原创 Leetcode-Dynamic Programming題目總結

動態規劃Dynamic Programming:通過把原問題分解爲相對簡單的子問題的方法來求解複雜問題的方法。 把求解的問題分成多個階段或多個子問題,然後按照順序求解各子問題。前一子問題的解,爲後一問題的求解提供了有用信息。依次解決各個子

原创 劍指Offer-醜數

轉載地址:https://www.jianshu.com/p/9598e96ea6b6題目:我們把只包含因子2、3和5的數稱作醜數(Ugly Number)。求按從小到大的順序的第1500個醜數。習慣上把1當做第一個醜數解法一:判斷一個數

原创 劍指Offer-樹的子結構

這道題題目的思路總結:1)二叉樹B當前節點值等於二叉樹A當時節點值,則遞歸地去匹配B的左子樹和A的左子樹,B的右子樹和A的右子樹2)二叉樹B當前節點值不等於二叉樹A當時節點值,則考慮B是否是A的左子樹的子結構,或者B是A的右子樹的子結構開

原创 劍指Offer-二進制中1個個數

轉自https://www.cnblogs.com/AndyJee/p/4630568.html題目:輸入一個整數,輸出該數二進制表示中1的個數。其中負數用補碼錶示。思路:很明顯,這道題考察的是位運算。1、依次將整數右移,判斷整數最後一位

原创 劍指Offer-兩個鏈表的第一個公共節點

一、題目:兩個鏈表的第一個公共節點題目:輸入兩個鏈表,找出它們的第一個公共結點。  鏈表結點定義如下,這裏使用C#語言描述: public class Node { public int key;

原创 劍指Offer-二維數組的查找

題目描述:在一個二維數組中,每一行都按照從左到右遞增的順序排序,每一列都按照從上到下遞增的順序排序。請完成一個函數,輸入這樣的一個二維數組和一個整數,判斷數組中是否含有該整數剛看到這道題目的時候,覺得和leetcode中一道數組查找題目很

原创 [leetcode]-460 LFU Cache

題目: Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operat

原创 劍指Offer-二叉搜索樹的後序遍歷序列

題目描述輸入一個整數數組,判斷該數組是不是某二叉搜索樹的後序遍歷的結果。如果是則輸出Yes,否則輸出No。假設輸入的數組的任意兩個數字都互不相同。首先我們給出二叉搜索樹的定義:二叉搜索樹,也稱有序二叉樹,排序二叉樹,是指一棵空樹或者具有下

原创 [leetcode]-954. Array of Doubled Pairs

題目: Given an array of integers A with even length, return true if and only if it is possible to reorder it such that A[