CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 2486. Append Characters to String to Make Subsequence

You are given two strings s and t consisting of only lowercase English letters. Return the minimum number of characters that need to be appended to the end of s so that t becomes a subsequence of s. A
2023-07-19
#leetcode #two pointer #java #greedy #string

[LeetCode] 2461. Maximum Sum of Distinct Subarrays With Length K

You are given an integer array nums and an integer k. Find the maximum subarray sum of all the subarrays of nums that meet the following conditions:The length of the subarray is k, andAll the elements
2023-07-19
#leetcode #array #hashmap #java #sliding window #sliding window with fixed size

[LeetCode] 2024. Maximize the Confusion of an Exam

A teacher is writing a test with n true/false questions, with ‘T’ denoting true and ‘F’ denoting false. He wants to confuse the students by maximizing the number of consecutive questions with the
2023-07-07
#leetcode #java #sliding window #string

[LeetCode] 1071. Greatest Common Divisor of Strings

For two strings s and t, we say “t divides s” if and only if s = t + … + t (i.e., t is concatenated with itself one or more times). Given two strings str1 and str2, return the largest string x su
2023-06-27
#leetcode #java #math #gcd #string

[LeetCode] 2090. K Radius Subarray Averages

You are given a 0-indexed array nums of n integers, and an integer k. The k-radius average for a subarray of nums centered at some index i with the radius k is the average of all elements in nums betw
2023-06-20
#leetcode #array #java #prefix sum #sliding window

[LeetCode] 2460. Apply Operations to an Array

You are given a 0-indexed array nums of size n consisting of non-negative integers. You need to apply n - 1 operations to this array where, in the ith operation (0-indexed), you will apply the followi
2023-06-05
#leetcode #array #two pointer #java #simulation

[LeetCode] 2559. Count Vowel Strings in Ranges

You are given a 0-indexed array of strings words and a 2D array of integers queries. Each query queries[i] = [li, ri] asks us to find the number of strings present in the range li to ri (both inc
2023-06-02
#leetcode #array #java #prefix sum #string

[LeetCode] 2441. Largest Positive Integer That Exists With Its Negative

Given an integer array nums that does not contain any zeros, find the largest positive integer k such that -k also exists in the array. Return the positive integer k. If there is no such integer, retu
2023-05-13
#leetcode #array #hashmap #java

[LeetCode] 1031. Maximum Sum of Two Non-Overlapping Subarrays

Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in two non-overlapping subarrays with lengths firstLen and secondLen. The array with length firs
2023-04-28
#leetcode #array #java #prefix sum

[LeetCode] 2336. Smallest Number in Infinite Set

You have a set which contains all positive integers [1, 2, 3, 4, 5, …]. Implement the SmallestInfiniteSet class:SmallestInfiniteSet() Initializes the SmallestInfiniteSet object to contain all positive
2023-04-26
#leetcode #hashmap #java #design #heap
1…1415161718…41

Search

Hexo Fluid