CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 1935. Maximum Number of Words You Can Type

There is a malfunctioning keyboard where some letter keys do not work. All other keys on the keyboard work properly. Given a string text of words separated by a single space (no leading or trailing sp
2025-09-14
#leetcode #java #hashmap #string

[LeetCode] 1504. Count Submatrices With All Ones

Given an m x n binary matrix mat, return the number of submatrices that have all ones. Example 1:Input: mat = [[1,0,1],[1,1,0],[1,1,0]]Output: 13Explanation:There are 6 rectangles of side 1x1.The
2025-08-21
#leetcode #java #array #stack #monotonic stack

[LeetCode] 2044. Count Number of Maximum Bitwise-OR Subsets

Given an integer array nums, find the maximum possible bitwise OR of a subset of nums and return the number of different non-empty subsets with the maximum bitwise OR. An array a is a subset of an arr
2025-07-27
#leetcode #dfs #java #array #backtracking #bit manipulation

[LeetCode] 2210. Count Hills and Valleys in an Array

You are given a 0-indexed integer array nums. An index i is part of a hill in nums if the closest non-equal neighbors of i are smaller than nums[i]. Similarly, an index i is part of a valley in nums i
2025-07-26
#leetcode #java #array

[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 #bfs #java #array #hashmap #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 #java #array #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 #java #greedy #two pointer #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
1234…48

Search

Hexo Fluid