2015年6月1日
摘要: 用vector投机取巧了。看网上大神的数组代码。双指针的应用。class Solution {public: int removeElement(int A[], int n, int elem) { // Start typing your C/C++ solution bel... 阅读全文
posted @ 2015-06-01 09:48 88123 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 这种渣题都调了两次,还是欠练啊。class Solution {public: int removeElement(vector& nums, int val) { int i=0; int k=0; int j=nums.size(); ... 阅读全文
posted @ 2015-06-01 06:02 88123 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2015-06-01 05:42 88123 阅读(117) 评论(0) 推荐(0) 编辑
  2015年5月28日
摘要: class Solution {public: int countPrimes(int n) { int count=0; vectormap(n+1,true); for(int i=2;i<n;i++){ if(map[i])... 阅读全文
posted @ 2015-05-28 04:38 88123 阅读(168) 评论(0) 推荐(0) 编辑
  2015年5月27日
摘要: class Solution {public: bool isIsomorphic(string s, string t) { mapxmap; if(s.size()!=t.size()){ return false; } ... 阅读全文
posted @ 2015-05-27 20:33 88123 阅读(108) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: vector twoSum(vector& nums, int target) { maphash; build(nums,hash); int index2=0; vectorresult... 阅读全文
posted @ 2015-05-27 08:12 88123 阅读(111) 评论(0) 推荐(0) 编辑