原创 leetcode481. Magical String

題目要求 A magical string S consists of only '1' and '2' and obeys the following rules: The string S is magical because con

原创 深入探尋JAVA8 part1:函數式編程與Lambda表達式

開篇 在很久之前粗略的看了一遍《Java8 實戰》。客觀的來,說這是一本寫的非常好的書,它由淺入深的講解了JAVA8的新特性以及這些新特性所解決的問題。最近重新拾起這本書並且對書中的內容進行深入的挖掘和沉澱。接下來的一段時間將會結合這本書,

原创 leetcode477. Total Hamming Distance

題目要求 The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

原创 leetcode467. Unique Substrings in Wraparound String

題目要求 Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like thi

原创 leetcode407. Trapping Rain Water II

題目要求 Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute

原创 leetcode474. Ones and Zeroes

題目要求 In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursu

原创 leetcode435. Non-overlapping Intervals

題目要求 Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the in

原创 Mockito入門:如何在Spring中Mock部分對象

前情提要 隨着分佈式應用的開發逐漸成爲標配,多個微服務團隊合作來完成垂直業務的開發成爲了一種常態。微服務使得團隊可以專注於自己的業務邏輯,在和下游依賴和上游對接的團隊聚焦好接口之後,就進入正式的開發。但是,每個團隊的開發節奏往往不同,下游依

原创 leetcode463. Island Perimeter

題目要求 You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid

原创 leetcode486. Predict the Winner

題目要求 Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the a

原创 leetcode433. Minimum Genetic Mutation

題目要求 A gene string can be represented by an 8-character long string, with choices from "A", "C", "G", "T". Suppose we n

原创 leetcode462. Minimum Moves to Equal Array Elements II

題目要求 Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where

原创 leetcode436. Find Right Interval

題目要求 Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigg

原创 leetcode430. Flatten a Multilevel Doubly Linked List

題目要求 You are given a doubly linked list which in addition to the next and previous pointers, it could have a child point

原创 leetcode442. Find All Duplicates in an Array

題目要求 Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. F