加载中...
分类详情
中等 分类
443-压缩字符串(String Compression)
原文链接: https://leetcode-cn.com/problems/string-compression 英文原文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 len…
2021-12-03
445-两数相加 II(Add Two Numbers II)
原文链接: https://leetcode-cn.com/problems/add-two-numbers-ii 英文原文You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers…
2021-12-03
454-四数相加 II(4Sum II)
原文链接: https://leetcode-cn.com/problems/4sum-ii 英文原文Given four integer arrays nums1, nums2, nums3, and nums4 all of length n, return the number of tuples (i, j, k, l) such that: 0 <= i, j, k, l < n nums1[i] + nums2[j] + nums3[k] + nums4[l] == 0 Exampl…
2021-12-03
468-验证IP地址(Validate IP Address)
原文链接: https://leetcode-cn.com/problems/validate-ip-address 英文原文Given a string queryIP, return "IPv4" if IP is a valid IPv4 address, "IPv6" if IP is a valid IPv6 address or "Neither" if IP is not a correct IP of any type. A valid IPv4 address is an IP…
2021-12-03
474-一和零(Ones and Zeroes)
原文链接: https://leetcode-cn.com/problems/ones-and-zeroes 英文原文You are given an array of binary strings strs and two integers m and n. Return the size of the largest subset of strs such that there are at most m 0's and n 1's in the subset. A set x is a s…
2021-12-03
481-神奇字符串(Magical String)
原文链接: https://leetcode-cn.com/problems/magical-string 英文原文A magical string s consists of only '1' and '2' and obeys the following rules: The string s is magical because concatenating the number of contiguous occurrences of characters '1' and '2' gene…
2021-12-03
494-目标和(Target Sum)
原文链接: https://leetcode-cn.com/problems/target-sum 英文原文You are given an integer array nums and an integer target. You want to build an expression out of nums by adding one of the symbols '+' and '-' before each integer in nums and then concatenate all…
2021-12-03
498-对角线遍历(Diagonal Traverse)
原文链接: https://leetcode-cn.com/problems/diagonal-traverse 英文原文Given an m x n matrix mat, return an array of all the elements of the array in a diagonal order. Example 1: Input: mat = [[1,2,3],[4,5,6],[7,8,9]] Output: [1,2,4,7,5,3,6,8,9] Example 2: Inp…
2021-12-03
518-零钱兑换 II(Coin Change 2)
原文链接: https://leetcode-cn.com/problems/coin-change-2 英文原文You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the number of combinations that make up tha…
2021-12-03