原创 LeetCode 670. Maximum Swap

問題描述 Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return

原创 LeetCode 81. Search in Rotated Sorted Array II

問題描述 Follow up for “Search in Rotated Sorted Array”: What if duplicates are allowed? Would this affect the run-

原创 LeetCode 153. Find Minimum in Rotated Sorted Array

問題描述 Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4

原创 LeetCode 414. Third Maximum Number

問題描述 Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, retu

原创 LeetCode 532. K-diff Pairs in an Array

問題描述 Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array.

原创 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

原创 LeetCode 448. Find All Numbers Disappeared in an Array

問題描述 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appea

原创 Spring讀取Bean的過程

Spring中Bean加載的過程是一個關鍵的步驟。這個過程主要是通過BeanFactoyr中的getBean方法來實現的。具體的方法是在AbstractBeanFactory方法中實現的。getBean方法主要有兩個功能,首先是去

原创 LeetCode 79. Word Search

問題描述 Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of

原创 Spring中循環依賴

Spring中bean的實例化方法主要是 prototype和singleton兩種。其中singleton的循環依賴包括兩種:構造器循環依賴,和setter的循環依賴。prototype中的循環依賴。 1.singleton 構

原创 LeetCode 119. Pascal's Triangle II

問題描述 Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3, Return [1,3,3,1]. No

原创 LeetCode 268. Missing Number

問題描述 Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the a

原创 Spring FactoryBean

Spring中提供了一種方便擴展/構造Bean的機制。在獲取bean的時候,發現是一個普通bean直接返回,如果是一個FactoryBean就調用FactoryBean中的getObject接口返回對應bean。 接口 publi

原创 linux常用命令

linux常用命令 壓縮/解壓命令 解壓:tar zxvf fileName.tar 壓縮:tar czvf fileName.tar dirName 範例: tar zxvf fileName.tar 表示將fileName的ta

原创 跨行交易的一些常見的知識

跨行交易的一些常見的知識 實例 用戶在a銀行取b銀行賬戶中的錢,這個時候就屬於跨行取錢。 關鍵有兩個問題: 首先是 信息流 銀行之前是如何傳遞金錢的消息的。 第二是資金流: 銀行之間是如何傳遞金錢的。 這個過程是一個發展的過程