Java练习
PAcee1
这个作者很懒,什么都没留下…
展开
-
LeetCode-771. Jewels and Stones
You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character inS is a type of stone you have. You want to know how many of the ston...原创 2018-03-09 19:18:34 · 272 阅读 · 0 评论 -
LeetCode-654. Maximum Binary Tree
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow:The root is the maximum number in the array.The left subtree is the maximum tree constructed from ...原创 2018-03-09 19:22:25 · 302 阅读 · 0 评论 -
LeetCode-763. Partition Labels
A string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers representing th...原创 2018-03-10 20:57:22 · 441 阅读 · 0 评论 -
LeetCode-537. Complex Number Multiplication
Given two strings representing two complex numbers.You need to return a string representing their multiplication. Note i2 = -1 according to the definition.Example 1:Input: "1+1i", "1+1i" Output: "0+2i...原创 2018-03-20 21:36:31 · 241 阅读 · 0 评论 -
LeetCode-442.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.Find all the elements that appear twice in this array.Could you do it without extra spac...原创 2018-03-20 21:45:07 · 446 阅读 · 0 评论 -
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.Example:Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example:I...原创 2018-03-25 19:01:42 · 348 阅读 · 0 评论 -
Java集合-HashMap经典面试题
已知一个 HashMap<Integer, User>集合, User 有 name(String)和 age(int)属性。请写一个方法实现对HashMap 的排序功能,该方法接收 HashMap<Integer, User>为形参,返回类型为 HashMap<Integer, User>,要求对 HashMap 中的 User 的 age 倒序进行排...原创 2018-04-05 19:08:45 · 830 阅读 · 0 评论