GoCalf Calf 的自留地 · 昙花一现

全站内容

medium

  • 436. Find Right Interval

    Coding

    #Problem You are given an array of intervals, where intervals[i] = [startᵢ, endᵢ] and each startᵢ is unique. The right interval for an interval i is an interval j such that startⱼ >= endᵢ and startⱼ is minimized. Note that i may equal j. …

    medium
  • 731. My Calendar II

    Coding

    #Problem You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a triple booking. A triple booking happens when three events have some non-empty intersection (i.e., some moment is …

    medium
  • 581. Shortest Unsorted Continuous Subarray

    Coding

    #Problem Given an integer array nums, you need to find one continuous subarray such that if you only sort this subarray in non-decreasing order, then the whole array will be sorted in non-decreasing order. Return the shortest such subarray …

    medium
  • 2559. Count Vowel Strings in Ranges

    Coding

    #Problem You are given a 0-indexed array of strings words and a 2D array of integers queries. Each query queries[i] = [lᵢ, rᵢ] asks us to find the number of strings present in the range lᵢ to rᵢ (both inclusive) of words that start and end …

    medium
  • 729. My Calendar I

    Coding

    #Problem You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty intersection (i.e., some moment is …

    medium
  • 985. Sum of Even Numbers After Queries

    Coding

    #Problem You are given an integer array nums and an array queries where queries[i] = [valᵢ, indexᵢ]. For each query i, first, apply nums[indexᵢ] = nums[indexᵢ] + valᵢ, then print the sum of the even values of nums. Return an integer array …

    medium
  • 767. Reorganize String

    Coding

    #Problem Given a string s, rearrange the characters of s so that any two adjacent characters are not the same. Return any possible rearrangement of s or return "" if not possible. https://leetcode.com/problems/reorganize-string/ Example 1: …

    medium
  • 1765. Map of Highest Peak

    Coding

    #Problem You are given an integer matrix isWater of size m x n that represents a map of land and water cells. If isWater[i][j] == 0, cell (i, j) is a land cell. If isWater[i][j] == 1, cell (i, j) is a water cell. You must assign each cell a …

    medium
  • 542. 01 Matrix

    Coding

    #Problem Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two cells sharing a common edge is 1. https://leetcode.com/problems/01-matrix/ Example 1: case1Input: mat = …

    medium
  • 1029. Two City Scheduling

    Coding

    #Problem A company is planning to interview 2n people. Given the array costs where costs[i] = [aCostᵢ, bCostᵢ], the cost of flying the iᵗʰ person to city a is aCostᵢ, and the cost of flying the iᵗʰ person to city b is bCostᵢ. Return the …

    medium