[LeetCode]Find Anagram Mappings
题目描述:LeetCode 760. Find Anagram MappingsGiven two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of the elements in A.We want to find an index...
View Article[LeetCode]Bold Words in String
题目描述:LeetCode 758. Bold Words in StringGiven a set of keywords words and a string S, make all appearances of all keywords in S bold. Any letters between <b> and </b> tags become bold.The...
View Article[LeetCode]Employee Free Time
题目描述:LeetCode 759. Employee Free TimeWe are given a list avail of employees, which represents the free time for each employee.Each employee has a list of non-overlapping Intervals, and these intervals...
View Article[LeetCode]Prime Number of Set Bits in Binary Representation
题目描述:LeetCode 762. Prime Number of Set Bits in Binary RepresentationGiven two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime number of set bits in their...
View Article[LeetCode]Partition Labels
题目描述:LeetCode 763. Partition LabelsA string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return...
View Article[LeetCode]Largest Plus Sign
题目描述:LeetCode 764. Largest Plus SignIn a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given list mines which are 0. What is the largest axis-aligned plus sign...
View Article[LeetCode]Couples Holding Hands
题目描述:LeetCode 765. Couples Holding HandsN couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple is sitting side by side. A...
View ArticleLeetCode Weekly Contest 67解题报告
LeetCode Weekly Contest 67是LeetCode举办的第七十一场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-67/题解列表:LeetCode 762. Prime Number of Set Bits in Binary RepresentationLeetCode...
View Article[LeetCode]Toeplitz Matrix
题目描述:LeetCode 766. Toeplitz MatrixA matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element.Now given an M x N matrix, return True if and only if the matrix is...
View Article[LeetCode]Reorganize String
题目描述:LeetCode 767. Reorganize StringGiven a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.If possible, output any possible...
View Article[LeetCode]Max Chunks To Make Sorted (ver. 1)
题目描述:LeetCode 769. Max Chunks To Make Sorted (ver. 1)Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the array into some number of "chunks" (partitions), and...
View Article[LeetCode]Max Chunks To Make Sorted (ver. 2)
题目描述:LeetCode 768. Max Chunks To Make Sorted (ver. 2)This question is the same as "Max Chunks to Make Sorted (ver. 1)" except the integers of the given array are not necessarily distinct, the input...
View Article[LeetCode]Basic Calculator IV
题目描述:LeetCode 770. Basic Calculator IVGiven an expression such as expression = "e + 8 - a + 5" and an evaluation map such as {"e": 1} (given in terms of evalvars = ["e"] and evalints = [1]), return a...
View ArticleLeetCode Weekly Contest 68解题报告
LeetCode Weekly Contest 68是LeetCode举办的第七十二场正式周赛,共5道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-68/题解列表:LeetCode 766. Toeplitz MatrixLeetCode 767. Reorganize StringLeetCode...
View Article[LeetCode]Jewels and Stones
题目描述:LeetCode 771. Jewels and StonesYou're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have....
View Article[LeetCode]Global and Local Inversions
题目描述:LeetCode 775. Global and Local InversionsWe have some permutation A of [0, 1, ..., N - 1], where N is the length of A.The number of (global) inversions is the number of i < j with 0 <= i...
View Article[LeetCode]Sliding Puzzle
题目描述:LeetCode 773. Sliding PuzzleOn a 2x3 board, there are 5 tiles represented by the integers 1 through 5, and an empty square represented by 0.A move consists of choosing 0 and a 4-directionally...
View Article[LeetCode]Minimize Max Distance to Gas Station
题目描述:LeetCode 774. Minimize Max Distance to Gas StationOn a horizontal number line, we have gas stations at positions stations[0], stations[1], ..., stations[N-1], where N = stations.length.Now, we add...
View ArticleLeetCode Weekly Contest 69解题报告
LeetCode Weekly Contest 69是LeetCode举办的第七十三场正式周赛,共4道题目,比赛时长1.5小时。比赛链接:https://leetcode.com/contest/leetcode-weekly-contest-69/题解列表:LeetCode 771. Jewels and StonesLeetCode 775. Global and Local...
View Article[LeetCode]K-th Symbol in Grammar
题目描述:LeetCode 779. K-th Symbol in GrammarOn the first row, we write a 0. Now in every subsequent row, we look at the previous row and replace each occurrence of 0 with 01, and each occurrence of 1 with...
View Article