原创 LeetCode.179 Largest Number

題目:Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30

原创 LeetCode.5 Longest Palindromic Substring

題目:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.E

原创 LeetCode.539 Minimum Time Difference(求時間最小間隔)

題目 Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between

原创 關於Maven你必須知道的知識點!!!

文章目錄0.0.<Maven實戰> 相關Maven實戰電子書地址請自行百度。 1.關於Maven相關基礎知識 Maven基本座標標籤含義 :定義項目屬於哪個組,這個組往往和項目所在的組織和公式有關。必填項 :定義當前Mav

原创 LeetCode.658 Find K Closest Elements(查找最近的k個數)

1.題目 Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should

原创 LeetCode.678 Valid Parenthesis String

題目 Given a string containing only three types of characters: ‘(’, ‘)’ and ‘*’, write a function to check whether th

原创 2018_今日頭條春招(第3題,666的顯示)

package 實習面試筆試題; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Today_Main

原创 LeetCode.303/304 Range Sum Query(2) - Immutable

303.題目(求數組子序列元素之和) Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclu

原创 LeetCode.221 Maximal Square(最大正方形面積)

題目 Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its are

原创 LeetCode.416 Partition Equal Subset Sum

題目:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets suc

原创 LeetCode.70(746) Climbing Stairs && Min Cost Climbing Stairs (典型的動態規劃求解Fibonacci問題)

題目70:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. I

原创 hihoCoder_01揹包問題 和hihoCoder_完全揹包問題

題目:#1038 : 01揹包時間限制:20000ms單點時限:1000ms內存限制:256MB描述且說上一週的故事裏,小Hi和小Ho費勁心思終於拿到了茫茫多的獎券!而現在,終於到了小Ho領取獎勵的時刻了!小Ho現在手上有M張獎券,而獎品

原创 JDK8-Optional類避免NPE

1.需求分析 調用RPC返回結果、包裝類轉簡單類型,拆箱過程最容易出現NPE問題。JDK8之前需要小心翼翼對各種類型進行判空,可通過JKD8-Optional類來預發未知的NPE錯誤。 2.關於避免NPE的常識 【強制】所有P

原创 ForkJoinPool線程池

在Java 7中引入了一種新的線程池:ForkJoinPool。 它同ThreadPoolExecutor一樣,也實現了Executor和ExecutorService接口。它使用了一個無限隊列來保存需要執行的任務,而線程的數量則是通過構

原创 JDK8新特性並行流-ParallelStream

package chap07.ParalleDemo; import java.util.function.Function; import java.util.stream.LongStream; import java.util.