Loading

上一页 1 2 3 4 5 6 ··· 15 下一页
摘要: class MaxQueue { Queue<Integer> queue; Deque<Integer> deque; public MaxQueue() { queue = new LinkedList<>(); deque = new LinkedList<>(); } public int 阅读全文
posted @ 2021-04-18 20:21 想用包子换论文 阅读(29) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int[] maxInWindows(int[] nums, int k) { if(nums == null || nums.length == 0) return new int[0]; int[] res = new int[nums.lengt 阅读全文
posted @ 2021-04-16 17:19 想用包子换论文 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 拆解步骤来做 class Solution { public String reverseLeftWords(String s, int n) { return s.substring(n,s.length()) + s.substring(0,n); } } 阅读全文
posted @ 2021-04-16 16:41 想用包子换论文 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 1、整个字符串反转 2、每个单词反转 the sky is blue ==> eulb si yks eht ==> blue is sky the ok 思路2 利用API,从后到前拼接String class Solution { public String reverseWords(Strin 阅读全文
posted @ 2021-04-15 17:07 想用包子换论文 阅读(46) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int[][] findContinuousSequence(int target) { List<List<Integer>> list = new ArrayList<>(); List<Integer> res = new ArrayList<> 阅读全文
posted @ 2021-04-15 16:22 想用包子换论文 阅读(22) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int[] twoSum(int[] nums, int target) { int i = 0; int j = nums.length - 1; while(i < j){ int s = nums[i] + nums[j]; if(s < tar 阅读全文
posted @ 2021-04-13 19:06 想用包子换论文 阅读(15) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int[] singleNumbers(int[] nums) { int xy = 0; for(int num: nums){ xy ^= num; } int k = 0; while((xy >> k & 1) == 0){ k++; } in 阅读全文
posted @ 2021-04-12 15:22 想用包子换论文 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 利用上一题求深度的做法 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = 阅读全文
posted @ 2021-04-12 15:00 想用包子换论文 阅读(29) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ 阅读全文
posted @ 2021-04-11 15:42 想用包子换论文 阅读(23) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ 阅读全文
posted @ 2021-04-11 15:41 想用包子换论文 阅读(29) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 15 下一页