10 2021 档案
摘要:题目 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
阅读全文
摘要:题目 Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example 1: Input: matrix = [
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 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
阅读全文
摘要:题目 数字 n 代表生成括号的对数,请你设计一个函数,用于能够生成所有可能的并且 有效的 括号组合。 有效括号组合需满足:左括号必须以正确的顺序闭合。 示例 1: 输入:n = 3 输出:["((()))","(()())","(())()","()(())","()()()"] 示例 2: 输入:
阅读全文