- 博客(5)
- 收藏
- 关注
原创 简单工厂模式
/简单工厂模式/ public class FactroyTest { public static void main(String[] args) { Operation oper = Factory.createOperate(“/”); oper.setNum1(1); oper.setNum2(2); Sys
2017-05-02 09:02:41
213
原创 【leetcode】combination-sum
题目描述:Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited numb
2017-04-07 15:34:33
171
原创 【leetcode】surrended-regions
给定一个矩阵,包含X和O,将其中被X包围的O全部替换成X。 思路: 1、遍历四边上的O,并深度遍历与其相连的O,将这些O替换成* 2、将剩余的O变成X,将*变成O 代码: public class Solution { public void solve(char[][] board) { if(board==null || board.length
2017-03-21 14:47:55
195
原创 【leetcode】股票交易日
在股市的交易日中,假设最多可进行两次买卖(即买和卖的次数均小于等于2),规则是必须一笔成交后进行另一笔(即买-卖-买-卖的顺序进行)。给出一天中的股票变化序列,请写一个程序计算一天可以获得的最大收益。请采用实践复杂度低的方法实现。 给定价格序列prices及它的长度n,请返回最大收益。保证长度小于等于500。 public class Stock { public int m
2017-03-18 19:54:44
340
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人