Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= n…
分类:LeetCode
[Java] 浅析Google Guava Multimap
类关系 ArrayListMultiMap.java Multimap <I> | | AbstractMultimap <A> Serializable <I> |_________…
LeetCode | Reverse Words in a String(字符串中的单词序反转)
Given an input string, reverse the string word by word. For example, Given s = “the sky is blue“, …
LeetCode算法题-Self Dividing Numbers(Java实现)
这是悦乐书的第305次更新,第324篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第173题(顺位题号是728)。自分割数是一个可被其包含的每个数字整除的数字。例如,128是自分割数,因为1…
Leetcode 159. Longest Substring with At Most Two Distinct Characters
Given a string, find the length of the longest substring T that contains at most 2 distinct characters. For ex…
329. Longest Increasing Path in a Matrix
虽然生活节奏很差,还在坚持一天至少一题(事实上每天都想多做几题,但发现往往只能保证一题,思考时间很长)。 这题让我想到word search,于是模仿word search写了一个dfs,但是数据多的时候会TLE。 BR…
244. Shortest Word Distance II
My Submissions Total Accepted: 16006 Total Submissions: 46068 Difficulty: Medium Contributors: Admin This is a…
[LeetCode] Best Time to Buy and Sell Stock with Cooldown 买股票的最佳时间含冷冻期,Best Time to Buy and Sell Stock IV 买卖股票的最佳时间之四
Say you have an array for which the ith element is the price of a given stock on day i. Design an algor…
[LeetCode] Chalkboard XOR Game 黑板亦或游戏
We are given non-negative integers nums[i] which are written on a chalkboard. Alice and Bob take …
LeetCode | Divide Two Integers
题目: Divide two integers without using multiplication, division and mod operator. 思路: 1)考虑边界问题。 2)考虑INT_MIN与INT…
LeetCode 209 Minimum Size Subarray Sum
题目描述 Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of …
LeetCode 169 Majority Element
题目描述 Given an array of size n, find the majority element. The majority element is the element that appears mor…