CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 3152. Special Array II

An array is considered special if every pair of its adjacent elements contains two numbers with different parity. You are given an array of integer nums and a 2D integer matrix queries, where for quer
2024-12-09
#leetcode #java #array #prefix sum

[LeetCode] 2684. Maximum Number of Moves in a Grid

You are given a 0-indexed m x n matrix grid consisting of positive integers. You can start at any cell in the first column of the matrix, and traverse the grid in the following way: From a cell (row,
2024-12-07
#leetcode #bfs #dfs #java #array #dynamic programming #matrix

[LeetCode] 2825. Make String a Subsequence Using Cyclic Increments

You are given two 0-indexed strings str1 and str2. In an operation, you select a set of indices in str1, and for each index i in the set, increment str1[i] to the next character cyclically. That is ‘a
2024-12-04
#leetcode #java #two pointer #string

[LeetCode] 3206. Alternating Groups I

There is a circle of red and blue tiles. You are given an array of integers colors. The color of tile i is represented by colors[i]:colors[i] == 0 means that tile i is red.colors[i] =&#
2024-11-25
#leetcode #java #array #sliding window

[LeetCode] 1861. Rotating the Box

You are given an m x n matrix of characters box representing a side-view of a box. Each cell of the box is one of the following:A stone ‘#’A stationary obstacle ‘*’Empty ‘.’ The box is rotated 90 degr
2024-11-24
#leetcode #java #array #two pointer #matrix

[LeetCode] 3238. Find the Number of Winning Players

You are given an integer n representing the number of players in a game and a 2D array pick where pick[i] = [xi, yi] represents that the player x picked a ball of color y. Player i wins the game
2024-11-22
#leetcode #java #array #hashmap #counting sort

[LeetCode] 2257. Count Unguarded Cells in the Grid

You are given two integers m and n representing a 0-indexed m x n grid. You are also given two 2D integer arrays guards and walls where guards[i] = [rowi, coli] and walls[j] = [rowj, colj] r
2024-11-21
#leetcode #java #array #flood fill #matrix #simulation

[LeetCode] 2516. Take K of Each Character From Left and Right

You are given a string s consisting of the characters ‘a’, ‘b’, and ‘c’ and a non-negative integer k. Each minute, you may take either the leftmost character of s, or the rightmost character of s. Ret
2024-11-20
#leetcode #java #hashmap #sliding window #string

[LeetCode] 1652. Defuse the Bomb

You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n and a key k. To decrypt the code, you must replace every number. All t
2024-11-18
#leetcode #java #array #sliding window

[LeetCode] 661. Image Smoother

An image smoother is a filter of the size 3 x 3 that can be applied to each cell of an image by rounding down the average of the cell and the eight surrounding cells (i.e., the average of the nine cel
2024-11-17
#leetcode #java #array #matrix
1…34567…44

Search

Hexo Fluid