GoCalf Calf 的自留地 · 昙花一现

全站内容

Calf

这里收录 Calf 在 GoCalf 上的文章、笔记与其他内容。

  • 42. Trapping Rain Water

    Coding

    #Problem Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. https://leetcode.com/problems/trapping-rain-water/ Example 1: case1Input: height = …

    hard todo
  • 424. Longest Repeating Character Replacement

    Coding

    #Problem You are given a string s and an integer k. You can choose any character of the string and change it to any other uppercase English character. You can perform this operation at most k times. Return the length of the longest …

    medium
  • 43. Multiply Strings

    Coding

    #Problem Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger library or convert the inputs to integer …

    medium
  • 435. Non-overlapping Intervals

    Coding

    #Problem Given an array of intervals intervals where intervals[i] = [startᵢ, endᵢ], return the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Note that intervals which only touch at a point …

    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
  • 443. String Compression

    Coding

    #Problem Given an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars: If the group’s length is 1, append the character to s. …

    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
  • 46. Permutations

    Coding

    #Problem Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. A permutation is a rearrangement of all the elements of an array. https://leetcode.cn/problems/permutations/ …

    easy
  • 47. Permutations II

    Coding

    #Problem Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order. https://leetcode.cn/problems/permutations-ii/ Example 1: Input: nums = [1,1,2] Output: json 复制 [[1,1,2], …

    easy
  • 48. Rotate Image

    Coding

    #Problem You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means you have to modify the input 2D matrix directly. DO NOT allocate another 2D …

    medium