package y2019.Algorithm.array; import java.util.*; /** * @ProjectName: cutter-point * @Package: y2019.Algorithm.array * @ClassName: CommonChars * @Author: xiaof * @Description: 1002. Find Common Characters * Given an array A of strings made only from…
题目等级:Easy 题目描述: Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false Explanation: From left to right, it reads -12…
题目等级:4Sum II(Medium) 题目描述: Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero. To make problem a bit easier, all A, B, C, D have same length of N where 0 ≤ N ≤ 500…
题目等级:4Sum(Medium) 题目描述: Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution se…
题目等级:3Sum(Medium) 题目描述: Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. Exam…
Best Time to Buy and Sell Stock with Transaction Fee 题目等级:Medium 题目描述: Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee. You m…
题目等级:Hard 题目描述:   There are two sorted arrays nums1 and nums2 of size m and n respectively.   Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).   You may assume nums1 and nums2 cannot be both empty.   E…
题目等级:Medium 题目描述:   You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.   You may…
题目等级:Easy 题目描述: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21    题意:给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转. 解题思路:   本题很简单,我们给出以下两种方法.  …
说实话,这道题我没想出来,但是看解题报告题解比较让人觉得眼前一亮,这里记录下来 package y2019.Algorithm.greedy.medium; import java.util.Arrays; import java.util.LinkedList; /** * @Auther: xiaof * @Date: 2019/12/19 09:05 * @Description: 406. 根据身高重建队列 * * 假设有打乱顺序的一群人站成一个队列. 每个人由一个整数对(h, k)表示…