CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 2105. Watering Plants II

Alice and Bob want to water n plants in their garden. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i. Each plant needs
2024-05-09
#leetcode #array #two pointer #java #simulation

[LeetCode] 2079. Watering Plants

You want to water n plants in your garden with a watering can. The plants are arranged in a row and are labeled from 0 to n - 1 from left to right where the ith plant is located at x = i. There i
2024-05-07
#leetcode #array #java #greedy #simulation

[LeetCode] 2487. Remove Nodes From Linked List

You are given the head of a linked list. Remove every node which has a node with a greater value anywhere to the right side of it. Return the head of the modified linked list. Example 1:Input: head &#
2024-05-06
#leetcode #java #recursion #stack #linked list #monotonic stack

[LeetCode] 2739. Total Distance Traveled

A truck has two fuel tanks. You are given two integers, mainTank representing the fuel present in the main tank in liters and additionalTank representing the fuel present in the additional tank in lit
2024-04-24
#leetcode #java #math

[LeetCode] 2073. Time Needed to Buy Tickets

There are n people in a line queuing to buy tickets, where the 0th person is at the front of the line and the (n - 1)th person is at the back of the line. You are given a 0-indexed integer array ticke
2024-04-09
#leetcode #array #java #simulation

[LeetCode] 2192. All Ancestors of a Node in a Directed Acyclic Graph

You are given a positive integer n representing the number of nodes of a Directed Acyclic Graph (DAG). The nodes are numbered from 0 to n - 1 (inclusive). You are also given a 2D integer array edges,
2024-04-06
#leetcode #java #bfs #dfs #graph #topological sort

[LeetCode] 2962. Count Subarrays Where Max Element Appears at Least K Times

You are given an integer array nums and a positive integer k. Return the number of subarrays where the maximum element of nums appears at least k times in that subarray. A subarray is a contiguous seq
2024-03-29
#leetcode #array #java #sliding window

[LeetCode] 2789. Largest Element in an Array after Merge Operations

You are given a 0-indexed array nums consisting of positive integers. You can do the following operation on the array any number of times:Choose an integer i such that 0 <= i < nums.length
2024-03-14
#leetcode #array #java #greedy

[LeetCode] 2129. Capitalize the Title

You are given a string title consisting of one or more words separated by a single space, where each word consists of English letters. Capitalize the string by changing the capitalization of each word
2024-03-10
#leetcode #java #string

[LeetCode] 2575. Find the Divisibility Array of a String

You are given a 0-indexed string word of length n consisting of digits, and a positive integer m. The divisibility array div of word is an integer array of length n such that: div[i] = 1 if the n
2024-03-06
#leetcode #array #java #MOD #math #string
1…89101112…41

Search

Hexo Fluid