全站内容
medium
43. Multiply Strings
#Problem Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger library or convert the inputs to integer …
769. Max Chunks To Make Sorted
#Problem You are given an integer array arr of length n that represents a permutation of the integers in the range [0, n - 1]. We split arr into some number of chunks (i.e., partitions), and individually sort each chunk. After concatenating …
714. Best Time to Buy and Sell Stock with Transaction Fee
#Problem You are given an array prices where prices[i] is the price of a given stock on the iᵗʰ day, and an integer fee representing a transaction fee. Find the maximum profit you can achieve. You may complete as many transactions as you …
309. Best Time to Buy and Sell Stock with Cooldown
#Problem 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 complete as many transactions as you like (i.e., buy one and sell one share of the stock …
739. Daily Temperatures
#Problem Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the iᵗʰ day to get a warmer temperature. If there is no future day …
503. Next Greater Element II
#Problem Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element in nums. The next greater number of a number x is the first greater number to its …
3291. Minimum Number of Valid Strings to Form Target I
#Problem You are given an array of strings words and a string target. A string x is called valid if x is a prefix of any string in words. A prefix of a string is a substring that starts from the beginning of the string and extends to any …
2182. Construct String With Repeat Limit
#Problem You are given a string s and an integer repeatLimit. Construct a new string repeatLimitedString using the characters of s such that no letter appears more than repeatLimit times in a row. You do not have to use all characters from …
122. Best Time to Buy and Sell Stock II
#Problem You are given an integer array prices where prices[i] is the price of a given stock on the iᵗʰ day. On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, …
1792. Maximum Average Pass Ratio
#Problem There is a school that has classes of students and each class will be having a final exam. You are given a 2D integer array classes, where classes[i] = [passᵢ, totalᵢ]. You know beforehand that in the iᵗʰ class, there are totalᵢ …