CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 815. Bus Routes

You are given an array routes representing bus routes where routes[i] is a bus route that the ith bus repeats forever. For example, if routes[0] = [1, 5, 7], this means that the 0th bus travels i
2025-07-22
#leetcode #array #hashmap #java #bfs #graph

[LeetCode] 2058. Find the Minimum and Maximum Number of Nodes Between Critical Points

A critical point in a linked list is defined as either a local maxima or a local minima. A node is a local maxima if the current node has a value strictly greater than the previous node and the next n
2025-07-21
#leetcode #java #linked list

[LeetCode] 3201. Find the Maximum Length of Valid Subsequence I

You are given an integer array nums.A subsequence sub of nums with length x is called valid if it satisfies: (sub[0] + sub[1]) % 2 == (sub[1] + sub[2]) % 2 == … == (sub[x
2025-07-15
#leetcode #array #java #greedy

[LeetCode] 3136. Valid Word

A word is considered valid if: It contains a minimum of 3 characters.It contains only digits (0-9), and English letters (uppercase and lowercase).It includes at least one vowel.It includes at least on
2025-07-15
#leetcode #java #string

[LeetCode] 2410. Maximum Matching of Players With Trainers

You are given a 0-indexed integer array players, where players[i] represents the ability of the ith player. You are also given a 0-indexed integer array trainers, where trainers[j] represents the trai
2025-07-14
#leetcode #two pointer #java #greedy #sort

[LeetCode] 3330. Find the Original Typed String I

Alice is attempting to type a specific string on her computer. However, she tends to be clumsy and may press a key for too long, resulting in a character being typed multiple times. Although Alice tri
2025-06-30
#leetcode #java #string

[LeetCode] 2200. Find All K-Distant Indices in an Array

You are given a 0-indexed integer array nums and two integers key and k. A k-distant index is an index i of nums for which there exists at least one index j such that |i - j| <= k and nums[j]
2025-06-23
#leetcode #array #two pointer #java

[LeetCode] 2138. Divide a String Into Groups of Size k

A string s can be partitioned into groups of size k using the following procedure: The first group consists of the first k characters of the string, the second group consists of the next k characters
2025-06-21
#leetcode #java #string #simulation

[LeetCode] 2294. Partition Array Such That Maximum Difference Is K

You are given an integer array nums and an integer k. You may partition nums into one or more subsequences such that each element in nums appears in exactly one of the subsequences. Return the minimum
2025-06-18
#leetcode #array #java #greedy #sort

[LeetCode] 2566. Maximum Difference by Remapping a Digit

You are given an integer num. You know that Bob will sneakily remap one of the 10 possible digits (0 to 9) to another digit. Return the difference between the maximum and minimum values Bob can make b
2025-06-14
#leetcode #java #greedy #string
1234…48

Search

Hexo Fluid