GoCalf Calf 的自留地 · 昙花一现

全站内容

hard

  • 1531. String Compression II

    Coding

    #Problem Run-length encoding is a string compression method that works by replacing consecutive identical characters (repeated 2 or more times) with the concatenation of the character and the number marking the count of the characters …

    hard difficult
  • 51. N-Queens

    Coding

    #Problem The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. You may return the answer in any …

    hard
  • 2097. Valid Arrangement of Pairs

    Coding

    #Problem You are given a 0-indexed 2D integer array pairs where pairs[i] = [startᵢ, endᵢ]. An arrangement of pairs is valid if for every index i where 1 <= i < pairs.length, we have endᵢ₋₁ == startᵢ. Return any valid arrangement of pairs. …

    hard todo
  • 2577. Minimum Time to Visit a Cell In a Grid

    Coding

    #Problem You are given a m x n matrix grid consisting of non-negative integers where grid[row][col] represents the minimum time required to be able to visit the cell (row, col), which means you can visit the cell (row, col) only when the …

    hard
  • 3251. Find the Count of Monotonic Pairs II

    Coding

    跟 3250. Find the Count of Monotonic Pairs I 一模一样,只不过 nums[i] 的上限从 50 增加到 1000。 https://leetcode.cn/problems/find-the-count-of-monotonic-pairs-ii/ 直接用上次的代码似乎问题不大。

    hard
  • 3250. Find the Count of Monotonic Pairs I

    Coding

    #Problem You are given an array of positive integers nums of length n. We call a pair of non-negative integer arrays (arr1, arr2) monotonic if: The lengths of both arrays are n. arr1 is monotonically non-decreasing, in other words, arr1[0] …

    hard
  • 2290. Minimum Obstacle Removal to Reach Corner

    Coding

    #Problem You are given a 0-indexed 2D integer array grid of size m x n. Each cell has one of two values: 0 represents an empty cell, 1 represents an obstacle that may be removed. You can move up, down, left, or right from and to an empty …

    hard
  • 124. Binary Tree Maximum Path Sum

    Coding

    #Problem A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the …

    hard
  • 632. Smallest Range Covering Elements from K Lists

    Coding

    #Problem You have k lists of sorted integers in non-decreasing order. Find the smallest range that includes at least one number from each of the k lists. We define the range [a, b] is smaller than range [c, d] if b - a < d - c or a < c if b …

    hard
  • 212. Word Search II

    Coding

    #Problem Given an m x n board of characters and a list of strings words, return all words on the board. Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically …

    hard