作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 脑筋急转弯 日期 题目地址:https://leetcode.com/problems/moving-stones-until-consecutive/ 题目描述 Three stones are on a number line at positions a, b, and c. Each turn, you pick up a stone at…
题目如下: Three stones are on a number line at positions a, b, and c. Each turn, you pick up a stone at an endpoint (ie., either the lowest or highest position stone), and move it to an unoccupied position between those endpoints.  Formally, let's say th…
problem 1033. Moving Stones Until Consecutive 参考 1. Leetcode_easy_1033. Moving Stones Until Consecutive; 完…
[LeetCode]659. Split Array into Consecutive Subsequences 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/split-array-into-consecutive-subsequences/description/ 题目描述: You are g…
这道题是LeetCode里的第771道题. 题目要求: 给定字符串J 代表石头中宝石的类型,和字符串 S代表你拥有的石头. S 中每个字符代表了一种你拥有的石头的类型,你想知道你拥有的石头中有多少是宝石. J 中的字母不重复,J 和 S中的所有字符都是字母.字母区分大小写,因此"a"和"A"是不同类型的石头. 示例 1: 输入: J = "aA", S = "aAAbbbb" 输出: 3 示例 2: 输入: J = "…
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 preSum + 字典 日期 题目地址:https://leetcode.com/problems/remove-zero-sum-consecutive-nodes-from-linked-list/ 题目描述 Given the head of a linked list, we repeatedly delete consecutive sequ…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 DFS 日期 题目地址:https://leetcode.com/problems/numbers-with-same-consecutive-differences/ 题目描述 Return all non-negative integers of length N such that the absolute difference between…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 并查集 日期 题目地址:https://leetcode.com/problems/most-stones-removed-with-same-row-or-column/description/ 题目描述 On a 2D plane, we place stones at some integer coordinate points. Each c…
Jewels and Stones Description You'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. You want to know how many of the stones you have are also…
题目如下: Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences. After doing so, return the head of the final linked list.  You may return any such answer. (Note that in the e…