自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

翻译 [Leetcode] Best Time to Buy and Sell Stock III

public int maxProfit(int[] prices) { /* global[i][j]: i days, j transactions local[i][j]: i days, j transactions, the last is complete at the last day

2015-03-01 11:20:53 220

原创 [Leetcode] LRU Cache

public class LRUCache { class Node { int key; int value; Node left; Node right; Node(int k, int v){ this.key=k; this.value=v;

2015-02-18 11:26:32 237

原创 [Leetcode] Generate Parentheses

public ArrayList generateParenthesis(int n) { ArrayList res=new ArrayList(); StringBuilder sb=new StringBuilder(); helper(res,sb,n,n); return res; } public

2015-02-17 10:54:32 188

原创 [ LeetCode] Remove Duplicates from Sorted Array

两种办法,一种思考上比较细节,一种思考上比较简洁 public int removeDuplicates(int[] A) { if(A.length==0) return 0; if(A.length==1) return 1; int i=0; int j=0; while(i<A.length

2015-02-17 07:14:06 204

原创 [Leetcode] Median of Two Sorted Arrays

Problem: There are two sorted arrays A and B 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)). My code: public class So

2015-01-21 11:19:11 234

空空如也

空空如也

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

TA关注的人

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