CNoodle
  • Home
  • Archives
  • Tags
  • About

[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 #java #array #two pointer

[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 #java #array #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-13
#leetcode #java #greedy #string

[LeetCode] 386. Lexicographical Numbers

Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order. You must write an algorithm that runs in O(n) time and uses O(1) extra space. Example 1:Input: n =
2025-06-09
#leetcode #dfs #java #trie

[LeetCode] 2434. Using a Robot to Print the Lexicographically Smallest String

You are given a string s and a robot that currently holds an empty string t. Apply one of the following operations until s and t are both empty: Remove the first character of a string s and give it to
2025-06-05
#leetcode #java #greedy #string #stack

[LeetCode] 3403. Find the Lexicographically Largest String From the Box I

You are given a string word, and an integer numFriends. Alice is organizing a game for her numFriends friends. There are multiple rounds in the game, where in each round: word is split into numFriends
2025-06-03
#leetcode #java #string

[LeetCode] 3024. Type of Triangle

You are given a 0-indexed integer array nums of size 3 which can form the sides of a triangle. A triangle is called equilateral if it has all sides of equal length.A triangle is called isosceles if it
2025-05-18
#leetcode #java #array #sort #math

[LeetCode] 2874. Maximum Value of an Ordered Triplet II

You are given a 0-indexed integer array nums. Return the maximum value over all triplets of indices (i, j, k) such that i < j < k. If all such triplets have a negative value, return 0. The value
2025-04-01
#leetcode #java #array #hashmap #two sum
1234…47

Search

Hexo Fluid