GoCalf Calf 的自留地 · 昙花一现

全站内容

Calf

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

  • 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
  • 1547. Minimum Cost to Cut a Stick

    Coding

    #Problem Given a wooden stick of length n units. The stick is labelled from 0 to n. For example, a stick of length 6 is labelled as follows: stickGiven an integer array cuts where cuts[i] denotes a position you should perform a cut at. You …

    hard
  • 1552. Magnetic Force Between Two Balls

    Coding

    #Problem In the universe Earth C-137, Rick discovered a special form of magnetic force between two balls if they are put in his new invented basket. Rick has n empty baskets, the iᵗʰ basket is at position[i], Morty has m balls and needs to …

    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
  • 1591. Strange Printer II

    Coding

    #Problem There is a strange printer with the following two special requirements: On each turn, the printer will print a solid rectangular pattern of a single color on the grid. This will cover up the existing colors in the rectangle. Once …

    hard
  • 1610. Maximum Number of Visible Points

    Coding

    #Problem You are given an array points, an integer angle, and your location, where location = [pos_x, pos_y] and points[i] = [x_i, y_i] both denote integral coordinates on the X-Y plane. Initially, you are facing directly east from your …

    hard
  • 1639. Number of Ways to Form a Target String Given a Dictionary

    Coding

    #Problem You are given a list of strings of the same length words and a string target. Your task is to form target using the given words under the following rules: target should be formed from left to right. To form the iᵗʰ character …

    hard
  • 164. Maximum Gap

    Coding

    #Problem Given an integer array nums, return the maximum difference between two successive elements in its sorted form. If the array contains less than two elements, return 0. You must write an algorithm that runs in linear time and uses …

    medium
  • 1656. Design an Ordered Stream

    Coding

    #Problem There is a stream of n (idKey, value) pairs arriving in an arbitrary order, where idKey is an integer between 1 and n and value is a string. No two pairs have the same id. Design a stream that returns the values in increasing order …

    easy
  • 168. Excel Sheet Column Title

    Coding

    #Problem Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet. For example: A -> 1 B -> 2 C -> 3 … Z -> 26 AA -> 27 AB -> 28 … https://leetcode.com/problems/excel-sheet-column-title/ Example …

    easy