GoCalf Calf 的自留地 · 昙花一现

全站内容

medium

  • 2658. Maximum Number of Fish in a Grid

    Coding

    #Problem You are given a 0-indexed 2D matrix grid of size m x n, where (r, c) represents: A land cell if grid[r][c] = 0, or A water cell containing grid[r][c] fish, if grid[r][c] > 0. A fisher can start at any water cell (r, c) and can do …

    medium
  • 1462. Course Schedule IV

    Coding

    #Problem There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [aᵢ, bᵢ] indicates that you must take course aᵢ first if you want to take …

    medium
  • 45. Jump Game II

    Coding

    #Problem You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0]. Each element nums[i] represents the maximum length of a forward jump from index i. In other words, if you are at nums[i], you …

    medium todo
  • 2948. Make Lexicographically Smallest Array by Swapping Elements

    Coding

    #Problem You are given a 0-indexed array of positive integers nums and a positive integer limit. In one operation, you can choose any two indices i and j and swap nums[i] and nums[j] if |nums[i] - nums[j]| <= limit. Return the …

    medium
  • 1267. Count Servers that Communicate

    Coding

    #Problem You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communicate if they are on the same row …

    medium
  • 1561. Maximum Number of Coins You Can Get

    Coding

    #Problem There are 3n piles of coins of varying size, you and your friends will take piles of coins as follows: In each step, you will choose any 3 piles of coins (not necessarily consecutive). Of your choice, Alice will pick the pile with …

    medium
  • 2017. Grid Game

    Coding

    #Problem You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix. Both robots initially start at (0, 0) and want …

    medium
  • 2661. First Completely Painted Row or Column

    Coding

    #Problem 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 and paint the cell in mat …

    medium
  • 2266. Count Number of Texts

    Coding

    #Problem Alice is texting Bob using her phone. The mapping of digits to letters is shown in the figure below. telephoneIn order to add a letter, Alice has to press the key of the corresponding digit i times, where i is the position of the …

    medium
  • 3097. Shortest Subarray With OR at Least K II

    Coding

    #Problem 跟 3095. Shortest Subarray With OR at Least K I 一模一样,只是问题规模更大。 https://leetcode.cn/problems/shortest-subarray-with-or-at-least-k-ii/ Constraints: 1 <= nums.length <= 2 * 10⁵ 0 <= nums[i] <= 10⁹ 0 <= k <= 10⁹ #Test Cases python 复制 …

    medium