GoCalf Calf 的自留地 · 昙花一现

全站内容

Calf

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

  • 1760. Minimum Limit of Balls in a Bag

    Coding

    #Problem You are given an integer array nums where the iᵗʰ bag contains nums[i] balls. You are also given an integer maxOperations. You can perform the following operation at most maxOperations times: Take any bag of balls and divide it …

    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
  • 1769. Minimum Number of Operations to Move All Balls to Each Box

    Coding

    #Problem You have n boxes. You are given a binary string boxes of length n, where boxes[i] is '0' if the iᵗʰ box is empty, and '1' if it contains one ball. In one operation, you can move one ball from a box to an adjacent box. Box i is …

    medium
  • 1790. Check if One String Swap Can Make Strings Equal

    Coding

    #Problem You are given two strings s1 and s2 of equal length. A string swap is an operation where you choose two indices in a string (not necessarily different) and swap the characters at these indices. Return true if it is possible to make …

    easy
  • 1792. Maximum Average Pass Ratio

    Coding

    #Problem There is a school that has classes of students and each class will be having a final exam. You are given a 2D integer array classes, where classes[i] = [passᵢ, totalᵢ]. You know beforehand that in the iᵗʰ class, there are totalᵢ …

    medium
  • 1800. Maximum Ascending Subarray Sum

    Coding

    #Problem Given an array of positive integers nums, return the maximum possible sum of an ascending subarray in nums. A subarray is defined as a contiguous sequence of numbers in an array. A subarray [numsl, numsl+1, ..., numsr-1, numsr] is …

    easy
  • 1812. Determine Color of a Chessboard Square

    Coding

    #Problem You are given coordinates, a string that represents the coordinates of a square of the chessboard. Below is a chessboard for your reference. problemReturn true if the square is white, and false if the square is black. The …

    easy
  • 1847. Closest Room

    Coding

    #Problem There is a hotel with n rooms. The rooms are represented by a 2D integer array rooms where rooms[i] = [roomIdᵢ, sizeᵢ] denotes that there is a room with room number roomIdᵢ and size equal to sizeᵢ. Each roomIdᵢ is guaranteed to be …

    hard
  • 188. Best Time to Buy and Sell Stock IV

    Coding

    #Problem You are given an integer array prices where prices[i] is the price of a given stock on the iᵗʰ day, and an integer k. Find the maximum profit you can achieve. You may complete at most k transactions: i.e. you may buy at most k …

    hard
  • 19. Remove Nth Node From End of List

    Coding

    #Problem Given the head of a linked list, remove the nᵗʰ node from the end of the list and return its head. https://leetcode.com/problems/remove-nth-node-from-end-of-list/ Example 1: case1Input: head = [1,2,3,4,5], n = 2 Output: [1,2,3,5] …

    medium