摘要:
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* d... 阅读全文
摘要:
class Solution { public: int searchInsert(vector& nums, int target) { int i; for(i=0;i=target) return i; } return i; } }; 阅读全文
摘要:
class Solution { public: void moveZeroes(vector& nums) { if(nums.empty()) return; int l=0; int r=0; int len=nums.size(); while(l<len&&r<len){ i... 阅读全文
摘要:
class Solution { public: int removeElement(vector& nums, int val) { if(nums.empty()) return 0; int l=0; int r=nums.size()-1; while(l<r){ if(nums[l]==va... 阅读全文
摘要:
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* m... 阅读全文