04 2022 档案
摘要:题目 Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting with any positive int
阅读全文
摘要:题目 Given an integer array nums, design an algorithm to randomly shuffle the array. All permutations of the array should be equally likely as a result
阅读全文
摘要:题目 Given two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive. Example 1
阅读全文
摘要:题目 Given an integer n, break it into the sum of k positive integers, where k >= 2, and maximize the product of those integers. Return the maximum prod
阅读全文
摘要:题目 You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Retu
阅读全文
摘要:题目 Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three operati
阅读全文
摘要:题目 Given two strings word1 and word2, return the minimum number of steps required to make word1 and word2 the same. In one step, you can delete exactl
阅读全文
摘要:题目 Given an integer array nums, return the number of longest increasing subsequences. Notice that the sequence has to be strictly increasing. Example
阅读全文
摘要:题目 Given an integer array nums, return the length of the longest strictly increasing subsequence. A subsequence is a sequence that can be derived from
阅读全文
摘要:题目 Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary
阅读全文
摘要:题目 An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the s
阅读全文
摘要:题目 An integer array is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the s
阅读全文
摘要:题目 Given a string s, return the longest palindromic substring in s. Example 1: Input: s = "babad" Output: "bab" Explanation: "aba" is also a valid ans
阅读全文
摘要:题目 There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-
阅读全文
摘要:题目 Given an array of non-negative integers nums, you are initially positioned at the first index of the array. Each element in the array represents yo
阅读全文
摘要:题目 You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum
阅读全文