CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 641. Design Circular Deque

Design your implementation of the circular double-ended queue (deque). Implement the MyCircularDeque class:MyCircularDeque(int k) Initializes the deque with a maximum size of k.boolean insertFront() A
2024-09-28
#leetcode #java #linked list #design #queue

[LeetCode] 2414. Length of the Longest Alphabetical Continuous Substring

An alphabetical continuous string is a string consisting of consecutive letters in the alphabet. In other words, it is any substring of the string “abcdefghijklmnopqrstuvwxyz”. For example, “abc” is a
2024-09-19
#leetcode #java #two pointer #string

[LeetCode] 884. Uncommon Words from Two Sentences

A sentence is a string of single-space separated words where each word consists only of lowercase letters. A word is uncommon if it appears exactly once in one of the sentences, and does not appear in
2024-09-17
#leetcode #java #hashmap #string

[LeetCode] 2419. Longest Subarray With Maximum Bitwise AND

You are given an integer array nums of size n. Consider a non-empty subarray from nums that has the maximum possible bitwise AND. In other words, let k be the maximum value of the bitwise AND of any s
2024-09-14
#leetcode #java #array #bit manipulation

[LeetCode] 2326. Spiral Matrix IV

You are given two integers m and n, which represent the dimensions of a matrix. You are also given the head of a linked list of integers. Generate an m x n matrix that contains the integers in the lin
2024-09-14
#leetcode #java #array #matrix #linked list #simulation

[LeetCode] 885. Spiral Matrix III

You start at the cell (rStart, cStart) of an rows x cols grid facing east. The northwest corner is at the first row and column in the grid, and the southeast corner is at the last row and column. You
2024-09-13
#leetcode #java #array #matrix #simulation

[LeetCode] 2390. Removing Stars From a String

You are given a string s, which contains stars *. In one operation, you can:Choose a star in s.Remove the closest non-star character to its left, as well as remove the star itself.Return the string af
2024-09-13
#leetcode #java #string #stack #simulation

[LeetCode] 2181. Merge Nodes in Between Zeros

You are given the head of a linked list, which contains a series of integers separated by 0’s. The beginning and end of the linked list will have Node.val == 0. For every two consecutive 0’s
2024-09-08
#leetcode #java #linked list #simulation

[LeetCode] 3142. Check if Grid Satisfies Conditions

You are given a 2D matrix grid of size m x n. You need to check if each cell grid[i][j] is:Equal to the cell below it, i.e. grid[i][j] == grid[i + 1][j] (if it exists).Different from the cel
2024-08-28
#leetcode #java #array #matrix

[LeetCode] 2053. Kth Distinct String in an Array

A distinct string is a string that is present only once in an array. Given an array of strings arr, and an integer k, return the kth distinct string present in arr. If there are fewer than k distinct
2024-08-04
#leetcode #java #array #hashmap #string
1…678910…43

Search

Hexo Fluid