摘要: class Solution {public: int removeElement(int A[], int n, int elem) { if (A == NULL || n < 1) return 0; int rpos = 0, wpos = 0; ... 阅读全文
posted @ 2014-06-24 14:42 卖程序的小歪 阅读(118) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int reverse(int x) { bool neg = x = 0; 8 while (x) { 9 int d = x % 10;10 if (positiv... 阅读全文
posted @ 2014-06-24 14:34 卖程序的小歪 阅读(150) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(... 阅读全文
posted @ 2014-06-24 14:27 卖程序的小歪 阅读(174) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(... 阅读全文
posted @ 2014-06-24 14:19 卖程序的小歪 阅读(124) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int threeSumClosest(vector &num, int target) { int len = num.size(); if (len target) { q-... 阅读全文
posted @ 2014-06-24 11:07 卖程序的小歪 阅读(122) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *... 阅读全文
posted @ 2014-06-24 10:36 卖程序的小歪 阅读(130) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int maxProfit(vector &prices) { int len = prices.size(); if (len &prices) { int len = prices.size(); ... 阅读全文
posted @ 2014-06-24 02:19 卖程序的小歪 阅读(154) 评论(0) 推荐(0) 编辑