上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页
摘要: 题目 Given an integer array nums, find a contiguous non-empty subarray within the array that has the largest product, and return the product. It is guar 阅读全文
posted @ 2021-10-26 17:09 你也要来一颗长颈鹿吗 阅读(36) 评论(0) 推荐(0)
摘要: 题目 You are given an array prices where prices[i] is the price of a given stock on the iᵗʰ day. Find the maximum profit you can achieve. You may comple 阅读全文
posted @ 2021-10-26 15:39 你也要来一颗长颈鹿吗 阅读(29) 评论(0) 推荐(0)
摘要: 题目 Given an integer n, return the least number of perfect square numbers that sum to n. A perfect square is an integer that is the square of an intege 阅读全文
posted @ 2021-10-25 17:04 你也要来一颗长颈鹿吗 阅读(38) 评论(0) 推荐(0)
摘要: 题目 Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node 阅读全文
posted @ 2021-10-13 15:38 你也要来一颗长颈鹿吗 阅读(28) 评论(0) 推荐(0)
摘要: 题目 Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lo 阅读全文
posted @ 2021-10-13 12:28 你也要来一颗长颈鹿吗 阅读(23) 评论(0) 推荐(0)
摘要: 题目 Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the 阅读全文
posted @ 2021-10-13 10:46 你也要来一颗长颈鹿吗 阅读(22) 评论(0) 推荐(0)
摘要: 题目 数字 n 代表生成括号的对数,请你设计一个函数,用于能够生成所有可能的并且 有效的 括号组合。 有效括号组合需满足:左括号必须以正确的顺序闭合。 示例 1: 输入:n = 3 输出:["((()))","(()())","(())()","()(())","()()()"] 示例 2: 输入: 阅读全文
posted @ 2021-10-05 21:12 你也要来一颗长颈鹿吗 阅读(24) 评论(0) 推荐(0)
摘要: 快排算法 时间复杂度:O() 空间复杂度:O() public class QuickSort { public static void main(String[] args) { int[] num = {3,45,78,64,52,11,64,55,99,11,18}; System.out.p 阅读全文
posted @ 2021-09-29 10:10 你也要来一颗长颈鹿吗 阅读(91) 评论(0) 推荐(0)
摘要: 题目 Given a string s, return the number of palindromic substrings in it. A string is a palindrome when it reads the same backward as forward. A substri 阅读全文
posted @ 2021-09-27 16:08 你也要来一颗长颈鹿吗 阅读(24) 评论(0) 推荐(0)
摘要: 题目 Given a string s, return the longest palindromic substring in s. Example 1: Input: s = "babad" Output: "bab" Note: "aba" is also a valid answer. Ex 阅读全文
posted @ 2021-09-27 09:57 你也要来一颗长颈鹿吗 阅读(27) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页