摘要: 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] 阅读全文
posted @ 2022-01-06 20:02 传说中的旅行者 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-11-07 16:22 传说中的旅行者 阅读(23) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), rig 阅读全文
posted @ 2021-10-28 07:32 传说中的旅行者 阅读(29) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: vector<vector<int>> levelOrder(TreeNode* root) { vector<vector<int>> v2; if(!root) return v2; vector<vector<int>> v1; queue<T 阅读全文
posted @ 2021-10-26 12:54 传说中的旅行者 阅读(11) 评论(0) 推荐(0) 编辑
摘要: Character class 阅读全文
posted @ 2021-10-04 22:30 传说中的旅行者 阅读(30) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdlib.h> typedef struct QueueNode { int data; struct QueueNode *next; }QueueNode; typedef struct { QueueNode *front; Que 阅读全文
posted @ 2021-09-24 17:03 传说中的旅行者 阅读(17) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <stdbool.h> #include <stdlib.h> #define MaxQueueSize 5 typedef struct{ int data[MaxQueueSize]; int front; int rear; }SeQue 阅读全文
posted @ 2021-09-24 16:08 传说中的旅行者 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-06-17 15:48 传说中的旅行者 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-06-17 13:57 传说中的旅行者 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * struct ListNode *next; 6 * }; 7 */ 8 void deleteNode(struct ListNo 阅读全文
posted @ 2021-06-17 13:51 传说中的旅行者 阅读(54) 评论(0) 推荐(0) 编辑