12 2022 档案
摘要:Given a string s, return the number of homogenous substrings of s. Since the answer may be too large, return it modulo 109 + 7. A string is homogenous
阅读全文
摘要:You are given an integer array nums of length n, and an integer array queries of length m. Return an array answer of length m where answer[i] is the m
阅读全文
摘要:You have two types of tiles: a 2 x 1 domino shape and a tromino shape. You may rotate these shapes. Given an integer n, return the number of ways to t
阅读全文
摘要:You are given two strings word1 and word2. You want to construct a string merge in the following way: while either word1 or word2 are non-empty, choos
阅读全文
摘要:You are playing a solitaire game with three piles of stones of sizes a, b, and c respectively. Each turn you choose two different no
阅读全文
摘要:You are given an integer array nums where the ith bag contains nums[i] balls. You are also given an integer maxOperations. You can perform the followi
阅读全文
摘要:There is a bi-directional graph with n vertices, where each vertex is labeled from 0 to n - 1 (inclusive). The edges in the graph are represented as a
阅读全文
摘要:You are given an integer array nums and two integers limit and goal. The array nums has an interesting property that abs(nums[i]) <= limit. Return the
阅读全文
摘要:There is a binary tree rooted at 0 consisting of n nodes. The nodes are labeled from 0 to n - 1. You are given a 0-indexed integer array parents repre
阅读全文
摘要:Given an integer n, return true if it is possible to represent n as the sum of distinct powers of three. Otherwise, return false. An integer y is a po
阅读全文
摘要:You are given two arrays of integers nums1 and nums2, possibly of different lengths. The values in the arrays are between 1 and 6, inclusive. In one o
阅读全文
摘要:You are given a string word that consists of digits and lowercase English letters. You will replace every non-digit character with a space. For exampl
阅读全文
摘要:You are given a 0-indexed integer array nums of length n. nums contains a valid split at index i if the following are true: The sum of the first i + 1
阅读全文
摘要:You are given a 0-indexed integer array nums of length n. The average difference of the index i is the absolute difference between the average of the
阅读全文
摘要:You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the ith box is empty, and '1' if it contains one ball. In
阅读全文

浙公网安备 33010602011771号