作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 字典统计 日期 题目地址:https://leetcode-cn.com/problems/index-pairs-of-a-string/submissions/ 题目描述 You are given an array of strings words and a string chars. A string is good if it can be…
problem 1160. Find Words That Can Be Formed by Characters solution class Solution { public: int countCharacters(vector<string>& words, string chars) { ; unordered_map<char, int> charmap; for(auto ch:chars) charmap[ch]++; for(auto word:word…
[LeetCode]863. All Nodes Distance K in Binary Tree 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/description/ 题目描述: We are given a binary tree (with root no…
[LeetCode]378. Kth Smallest Element in a Sorted Matrix 解题报告(Python) 标签: LeetCode 题目地址:https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/description/ 题目描述: Given a n x n matrix where each of the rows and columns are sorted in ascen…
[LeetCode]331. Verify Preorder Serialization of a Binary Tree 解题报告(Python) 标签: LeetCode 题目地址:https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/description/ 题目描述: One way to serialize a binary tree is to use pre-order traver…
[LeetCode]154. Find Minimum in Rotated Sorted Array II 解题报告(Python) 标签: LeetCode 题目地址:https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/description/ 题目描述: Follow up for "Find Minimum in Rotated Sorted Array": What if duplicat…
[LeetCode]109. Convert Sorted List to Binary Search Tree 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.me/ 题目地址:https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/description/ 题目描述: Given a s…
[LeetCode]452. Minimum Number of Arrows to Burst Balloons 解题报告(Python) 标签(空格分隔): LeetCode 题目地址:https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/description/ 题目描述: There are a number of spherical balloons spread in two-dimensio…
题目如下: You are given an array of strings words and a string chars. A string is good if it can be formed by characters from chars (each character can only be used once). Return the sum of lengths of all good strings in words. Example 1: Input: words =…
LeetCode 第3题3 Longest Substring Without Repeating Characters 首先我们看题目要求: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "a…