摘要:
class Solution { public int findRepeatNumber(int[] nums) { Arrays.sort(nums); for(int i=0;i<nums.length-1;i++){ if(nums[i]==nums[i+1]){ return nums[i] 阅读全文
摘要:
class Solution { public: int findMaxConsecutiveOnes(vector<int>& nums) { int count=0; int max=count; for(int i=0;i<nums.size();i++){ if(nums[i]==1) co 阅读全文
摘要:
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), rig 阅读全文
摘要:
class Solution { public: vector<vector<int>> levelOrder(TreeNode* root) { vector<vector<int>> v2; if(!root) return v2; vector<vector<int>> v1; queue<T 阅读全文
摘要:
Character class 阅读全文
摘要:
#include <stdio.h> #include <stdlib.h> typedef struct QueueNode { int data; struct QueueNode *next; }QueueNode; typedef struct { QueueNode *front; Que 阅读全文
摘要:
#include <stdio.h> #include <stdbool.h> #include <stdlib.h> #define MaxQueueSize 5 typedef struct{ int data[MaxQueueSize]; int front; int rear; }SeQue 阅读全文
摘要:
1 typedef struct { 2 3 int data[10000]; 4 int top; 5 } MinStack; 6 7 /** initialize your data structure here. */ 8 9 MinStack* minStackCreate() { 10 M 阅读全文
摘要:
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * struct ListNode *next; 6 * }; 7 */ 8 9 10 /** 11 * Note: The retur 阅读全文
摘要:
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * struct ListNode *next; 6 * }; 7 */ 8 void deleteNode(struct ListNo 阅读全文