CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 2661. First Completely Painted Row or Column

You are given a 0-indexed integer array arr, and an m x n integer matrix mat. arr and mat both contain all the integers in the range [1, m * n]. Go through each index i in arr starting from index 0 an
2023-11-30
#leetcode #java #array #hashmap

[LeetCode] 1727. Largest Submatrix With Rearrangements

You are given a binary matrix matrix of size m x n, and you are allowed to rearrange the columns of the matrix in any order. Return the area of the largest submatrix within matrix where every element
2023-11-29
#leetcode #java #array #greedy #sort #matrix

[LeetCode] 1685. Sum of Absolute Differences in a Sorted Array

You are given an integer array nums sorted in non-decreasing order. Build and return an integer array result with the same length as nums such that result[i] is equal to the summation of absolute diff
2023-11-25
#leetcode #array #prefix sum #math

[LeetCode] 1424. Diagonal Traverse II

Given a 2D integer array nums, return all elements of nums in diagonal order as shown in the below images. Example 1:Input: nums = [[1,2,3],[4,5,6],[7,8,9]]Output: [1,4,2,7,5,3,8,6,9] Example 2:I
2023-11-24
#leetcode #java #array #sort #matrix

[LeetCode] 1630. Arithmetic Subarrays

A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the same. More formally, a sequence s is arithmetic if
2023-11-23
#leetcode #java #array #sort

[LeetCode] 2563. Count the Number of Fair Pairs

Given a 0-indexed integer array nums of size n and two integers lower and upper, return the number of fair pairs. A pair (i, j) is fair if:0 <= i < j < n, andlower <= nums[i] + n
2023-11-23
#leetcode #java #array #two pointer #sort

[LeetCode] 2824. Count Pairs Whose Sum is Less than Target

Given a 0-indexed integer array nums of length n and an integer target, return the number of pairs (i, j) where 0 <= i < j < n and nums[i] + nums[j] < target. Example 1:Input: nums &#
2023-11-23
#leetcode #java #array #two pointer #sort

[LeetCode] 1410. HTML Entity Parser

HTML entity parser is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself. The special characters and their entities for HTML are:Q
2023-11-22
#leetcode #java #string

[LeetCode] 1647. Minimum Deletions to Make Character Frequencies Unique

A string s is called good if there are no two different characters in s that have the same frequency. Given a string s, return the minimum number of characters you need to delete to make s good. The f
2023-11-21
#leetcode #java #hashmap #greedy #sort #string

[LeetCode] 2216. Minimum Deletions to Make Array Beautiful

You are given a 0-indexed integer array nums. The array nums is beautiful if:nums.length is even.nums[i] != nums[i + 1] for all i % 2 == 0.Note that an empty array is considered beautif
2023-11-21
#leetcode #java #array #greedy #stack
1…1213141516…43

Search

Hexo Fluid