2017年5月11日
摘要: 题目:'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover the entire input s... 阅读全文
posted @ 2017-05-11 00:34 lantx 阅读(112) 评论(0) 推荐(0) 编辑
  2017年5月10日
摘要: 题目:There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following ... 阅读全文
posted @ 2017-05-10 11:54 lantx 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 题目:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it co... 阅读全文
posted @ 2017-05-10 11:33 lantx 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 题目:You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路:思路就是先进行对角... 阅读全文
posted @ 2017-05-10 10:33 lantx 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.思路:1. 构造values,和numerals 数组保存 十进制数字 与罗马数字... 阅读全文
posted @ 2017-05-10 10:06 lantx 阅读(98) 评论(0) 推荐(0) 编辑
  2017年3月30日
摘要: 题目:There are N gas stations along a circular route, where the amount of gas at station i isgas[i].You have a car with an unlimited gas tank and it cos... 阅读全文
posted @ 2017-03-30 14:46 lantx 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 题目:Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].Total Acc... 阅读全文
posted @ 2017-03-30 14:29 lantx 阅读(123) 评论(0) 推荐(0) 编辑
  2017年3月15日
摘要: 题目:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any... 阅读全文
posted @ 2017-03-15 20:44 lantx 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/Qian123/p/5710533.html#_label0阅读目录为什么要克隆?如何实现克隆浅克隆和深克隆解决多层克隆问题总结假如说你想复制一个简单变量。很简单:int apples = 5; int pears = apples; 不仅仅是... 阅读全文
posted @ 2017-03-15 11:02 lantx 阅读(181) 评论(0) 推荐(0) 编辑
  2017年3月8日
摘要: C++的四种强制类型转换,所以C++不是类型安全的。分别为:static_cast , dynamic_cast , const_cast , reinterpret_cast为什么使用C风格的强制转换可以把想要的任何东西转换成合乎心意的类型。那为什么还需要一个新的C++类型的强制转换呢?新类型的强... 阅读全文
posted @ 2017-03-08 17:40 lantx 阅读(311) 评论(0) 推荐(0) 编辑