全站内容
Calf
这里收录 Calf 在 GoCalf 上的文章、笔记与其他内容。
721. Accounts Merge
#Problem Given a list of accounts where each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the account. Now, we would like to merge …
729. My Calendar I
#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 …
73. Set Matrix Zeroes
#Problem Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0’s. You must do it in place. https://leetcode.com/problems/set-matrix-zeroes/ Example 1: case1Input: matrix = [[1,1,1],[1,0,1],[1,1,1]] …
730. Count Different Palindromic Subsequences
#Problem Given a string s, return the number of different non-empty palindromic subsequences in s. Since the answer may be very large, return it modulo 10⁹ + 7. A subsequence of a string is obtained by deleting zero or more characters from …
731. My Calendar II
#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 …
732. My Calendar III
#Problem A k-booking happens when k events have some non-empty intersection (i.e., there is some time that is common to all k events.) You are given some events [startTime, endTime), after each given event, return an integer k representing …
739. Daily Temperatures
#Problem Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the iᵗʰ day to get a warmer temperature. If there is no future day …
743. Network Delay Time
#Problem You are given a network of n nodes, labeled from 1 to n. You are also given times, a list of travel times as directed edges times[i] = (uᵢ, vᵢ, wᵢ), where uᵢ is the source node, vᵢ is the target node, and wᵢ is the time it takes …
76. Minimum Window Substring
#Problem Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty …
767. Reorganize String
#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: …