全站内容
medium
3255. Find the Power of K-Size Subarrays II
跟 3254. Find the Power of K-Size Subarrays I 一模一样,只不过 n 的上限从 500 增加到 10⁵。 https://leetcode.cn/problems/find-the-power-of-k-size-subarrays-ii/
633. Sum of Square Numbers
#Problem Given a non-negative integer c, decide whether there’re two integers a and b such that a² + b² = c. https://leetcode.cn/problems/sum-of-square-numbers/ Example 1: Input: c = 5 Output: true Explanation: 1 * 1 + 2 * 2 = 5 Example 2: …
3208. Alternating Groups II
#Problem There is a circle of red and blue tiles. You are given an array of integers colors and an integer k. The color of tile i is represented by colors[i]: colors[i] == 0 means that tile i is red. colors[i] == 1 means that tile i is …
638. Shopping Offers
#Problem In LeetCode Store, there are n items to sell. Each item has a price. However, there are some special offers, and a special offer consists of one or more different kinds of items with a sale price. You are given an integer array …
3259. Maximum Energy Boost From Two Drinks
#Problem You are given two integer arrays energyDrinkA and energyDrinkB of the same length n by a futuristic sports scientist. These arrays represent the energy boosts per hour provided by two different energy drinks, A and B, respectively. …
2924. Find Champion II
#Problem There are n teams numbered from 0 to n - 1 in a tournament; each team is also a node in a DAG. You are given the integer n and a 0-indexed 2D integer array edges of length m representing the DAG, where edges[i] = [uᵢ, vᵢ] indicates …
371. Sum of Two Integers
#Problem Given two integers a and b, return the sum of the two integers without using the operators + and -. https://leetcode.com/problems/sum-of-two-integers/ Example 1: Input: a = 1, b = 2 Output: 3 Example 2: Input: a = 2, b = 3 Output: …
743. Network Delay Time
#Problem You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (uᵢ, vᵢ, wᵢ), where uᵢ is the source node, vᵢ is the target node, and wᵢ is the time it takes …
238. Product of Array Except Self
#Problem Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer. You …
235. Lowest Common Ancestor of a Binary Search Tree
#Problem Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the …