上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 32 下一页
摘要: Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linea 阅读全文
posted @ 2022-11-20 16:04 MarkLeeBYR 阅读(14) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example 1: 阅读全文
posted @ 2022-11-20 15:40 MarkLeeBYR 阅读(24) 评论(0) 推荐(0)
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1, 3, 2],The longes 阅读全文
posted @ 2022-11-20 14:46 MarkLeeBYR 阅读(17) 评论(0) 推荐(0)
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2022-11-19 22:35 MarkLeeBYR 阅读(19) 评论(0) 推荐(0)
摘要: iven numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return : [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] 阅读全文
posted @ 2022-11-19 22:02 MarkLeeBYR 阅读(31) 评论(0) 推荐(0)
摘要: /例如根节点为1,左2右3 class Solution { TreeNode prev = null; public void flatten(TreeNode root) {//先把最大的数设在root.right,然后剩下的数一个个往里加 if (root == null) return; f 阅读全文
posted @ 2022-11-19 20:58 MarkLeeBYR 阅读(25) 评论(0) 推荐(0)
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. public TreeNode sortedArrayToBST(int[] nums) { if (n 阅读全文
posted @ 2022-11-19 19:14 MarkLeeBYR 阅读(13) 评论(0) 推荐(0)
摘要: 见剑指offer重建二叉树 https://www.cnblogs.com/MarkLeeBYR/p/9777253.html 阅读全文
posted @ 2022-11-19 19:10 MarkLeeBYR 阅读(13) 评论(0) 推荐(0)
摘要: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2022-11-19 19:00 MarkLeeBYR 阅读(11) 评论(0) 推荐(0)
摘要: Solution 1: class Solution { public List<List<Integer>> levelOrder(TreeNode root) { Queue<TreeNode> queue = new LinkedList<>(); List<List<Integer>> wr 阅读全文
posted @ 2022-11-19 18:58 MarkLeeBYR 阅读(18) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 32 下一页