自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Java文件读写

字符流 FileReader, FileWriter 转换流 BufferedReader, BufferedWriter import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java

2016-03-25 21:16:03 267

原创 [Facebook 面试题]Meeting roomII 变形题

facebook 二面题目: interval [startTime, stoptime)   ----integral  time stamps 给这样的一串区间 I1, I2......In   找出 一个 time stamp  出现在interval的次数最多。 startTime example:  [1,3),  [2, 7),   [4,  8),   [5, 9)

2016-03-24 14:39:39 1073

原创 [LeetCode 253] Meeting Rooms II

Given an array of meeting time intervals consisting of start and end times [[s1,e1], [s2,e2],...] (si  For example, Given [[0, 30],[5, 10],[15, 20]], return 2. 线段最大重叠数 class Solution {

2016-03-23 21:30:16 732

原创 [LeetCode 265] Count Univalue Subtrees

题目: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree means all nodes of the subtree have the same value. For example: Given binary tree,

2016-03-23 20:03:42 554

转载 [LeetCode] Shortest Word Distance I & II & III (好题)

转自: http://www.cnblogs.com/easonliu/p/4784826.html Shortest Word Distance Given a list of words and two words word1 and word2, return the shortest distance between these two words in the l

2016-03-23 19:23:59 778

原创 [Leetcode 265]Paint House II

题目链接: http://www.lintcode.com/en/problem/paint-house-ii/ There are a row of n houses, each house can be painted with one of the k colors. The cost of painting each house with a certain colo

2016-03-23 17:32:37 1030

原创 [Leetcode 256]Paint House

题目链接:http://www.lintcode.com/en/problem/paint-house/ There are a row of n houses, each house can be painted with one of the three colors: red, blue or green. The cost of painting each house with a

2016-03-23 17:07:57 347

转载 leetcode 280: Wiggle Sort

Wiggle Sort Total Accepted: 1291 Total Submissions: 3008 Difficulty: Medium Given an unsorted array nums, reorder it in-place such that nums[0] = nums[2] . For example, given 

2016-03-23 11:00:01 308

原创 [Leetcode 286]: Walls and Gates

Walls and Gates Total Accepted: 411 Total Submissions: 1365 Difficulty: Medium You are given a m x n 2D grid initialized with these three possible values. -1 - A wall or an ob

2016-03-23 10:03:57 455

原创 [LeetCode] Reverse Words in a String II(in-place 算法)

Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters. The input string does not contain leading or trailing spaces and the words are always

2016-03-22 17:16:13 635

原创 [Lintcode]Reverse Words in a String

Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". Have you met this question in a real interview?  Yes C

2016-03-22 17:05:18 327

原创 [LeetCode294] Flip Game II

You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take turns to flip twoconsecutive "++" into "--". The g

2016-03-22 16:31:19 302

原创 [Leetcode]Binary Tree Longest Consecutive Sequence

Binary Tree Longest Consecutive Sequence Total Accepted: 437 Total Submissions: 1351 Difficulty: Medium Given a binary tree, find the length of the longest consecutive sequence p

2016-03-22 16:04:02 614

原创 [Leetcode]Binary Tree Vertical Order Traversal

class Solution { public: vector> res; map> Map; vector> verticalOrder(TreeNode* root) { if(root==NULL) return res; dfs(root,0); map>::iterator it; for(it=Map.begin();it!=Map.end();it++) {

2016-03-22 15:03:22 236

原创 [LeetCode]Generalized Abbreviation

class SolutionTest { public: vector res; vector generateAbbreviations(string word) { if(word.size()==0) return res; dfs(word,"",0); return res; } void dfs(string& s,string cur,int start) {

2016-03-22 13:22:07 277

空空如也

空空如也

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

TA关注的人

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