原创 leetcode——Is Subsequence

原題目: Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case E

原创 leetcode——Longest Substring Without Repeating Characters

原題: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcb

原创 leetcode——Two Sum II - Input array is sorted

原題目: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to

原创 Java併發-懶漢式單例設計模式加volatile的原因

懶漢式單例的double check、例一: class SingletonClass{ private static SingletonClass instance = null; private Singlet

原创 leetcode——Add Two Numbers

原題目: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and

原创 Java設計模式 --- 七大常用設計模式

原文鏈接:https://blog.csdn.net/weixin_40834464/article/details/82958187   設計模式分爲三種類型,共23種: 創建型模式:單例模式、抽象工廠模式、建造者模式、工廠模式、原型模

原创 最大映射

有 n 個字符串,每個字符串都是由 A-J 的大寫字符構成。現在你將每個字符映射爲一個 0-9 的數字,不同字符映射爲不同的數字。這樣每個字符串就可以看做一個整數,唯一的要求是這些整數必須是正整數且它們的字符串不能有前導零。現在問你怎樣映

原创 leetcode——Find All Anagrams in a String

Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lower

原创 leetcode——Number of Boomerangs

原題: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such th

原创 leetcode——Non-overlapping Intervals

Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the inter

原创 leetcode——Best Time to Buy and Sell Stock

原題目: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permit

原创 leetcode——Remove K Digits

Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is th

原创 leetcode——Wiggle Subsequence

A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate bet

原创 leetcode——Intersection of Two Arrays

原題目: Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1], nums2 = 

原创 leetcode——TwoSum、3Sum

TwoSum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You