自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 Leetcode题解 321. Create Maximum Number

Create Maximum Number 题目描述Given two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. The relative order of the

2016-08-28 22:35:01 713

原创 字符串消消乐

遇到3个一样的就标记 public static void test(String s) { boolean modify = false; int len = 0; char[] re = new char[s.length()]; for (int i = 0; i < s.length(); i++) {

2016-08-28 11:13:56 4337

原创 Leetcode题解 15. 3Sum

Given an array S of n integers, are there elements a, b, c in S 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 duplic

2016-08-18 15:58:28 487

原创 Leetcode题解 120. Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle [ [2], [3,4], [6,5,

2016-08-17 23:40:07 326

原创 Leetcode题解 122. Best Time to Buy and Sell Stock II

假设有一个数组,它的第i个元素是一个给定的股票在第i天的价格。设计一个算法来找到最大的利润。你可以完成尽可能多的交易(多次买卖股票)。然而,你不能同时参与多个交易(你必须在再次购买前出售股票)。 解题思路 在Best Time to Buy and Sell Stock系列中,和本题最像的是Best Time to Buy and Sell Stock IV Best Time to Buy

2016-08-17 09:45:40 920 2

原创 Android中使用Handler造成内存泄露的分析和解决

什么是内存泄露? Java使用有向图机制,通过GC自动检查内存中的对象(什么时候检查由虚拟机决定),如果GC发现一个或一组对象为不可到达状态,则将该对象从内存中回收。也就是说,一个对象不被任何引用所指向,则该对象会在被GC发现的时候被回收;另外,如果一组对象中只包含互相的引用,而没有来自它们外部的引用(例如有两个对象A和B互相持有引用,但没有任何外部对象持有指向A或B的引用),这仍然属于不可到达,

2016-08-16 23:45:14 319

原创 Leetcode题解 219. Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and j is at most k.用hashMap

2016-08-16 00:05:44 738

原创 Leetcode题解 136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one.第一种解法就是《剑指offer》上的,下面是一种通用的解法:public class Solution { public static int singleNumber(int[] nums) {

2016-08-11 10:53:40 288

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除