
Leetcode
文章平均质量分 79
刘好念
真诚、勇敢、善良
展开
-
[LeetCode] 九坤-03. 数字默契考验
九坤-03. 数字默契考验 题解原创 2022-08-22 20:59:50 · 1221 阅读 · 2 评论 -
[LeetCode] 5933. k 镜像数字的和
本文介绍了一种求解LeetCode 5399的方法。通过模拟寻找十进制镜像数字,然后判断其对应的k进制表示是否也是镜像,直到统计得到n个镜像数字。原创 2021-11-22 09:37:50 · 1421 阅读 · 0 评论 -
[LeetCode] 2045. 到达目的地的第二短时间
描述了一种使用bfs求解的算法。原创 2021-11-19 17:07:50 · 554 阅读 · 0 评论 -
[LeetCode]1278. Palindrome Partitioning III
一、题意You are given a strings containing lowercase letters and an integer k. You need to :First, change some characters of sto other lowercase English letters.Then divide sinto k non-empty disjo...原创 2019-12-02 21:34:35 · 418 阅读 · 0 评论 -
[leetcode] 5182. Maximum Subarray Sum with One Deletion
一、题意Given an array of integers, return the maximum sum for anon-emptysubarray (contiguous elements) with at most one element deletion.In other words, you want to choose a subarray and optionally ...原创 2019-09-09 11:14:18 · 375 阅读 · 0 评论 -
[leetcode]5175. Can Make Palindrome from Substring
一、题意Given a string s, we make queries on substrings of s.For each query queries[i] = [left, right, k], we may rearrangethe substring s[left], ..., s[right], and then choose up to k of them to rep...原创 2019-09-01 17:52:33 · 331 阅读 · 0 评论 -
[leetcode]Leetcode中sort排序遇到的一些问题
转载自:https://www.cnblogs.com/flightless/p/10745318.htmlclass Solution {public: static bool cmp(vector<int>a,vector<int>b) { return a[0]-a[1]<b[0]-b[1]; } int...转载 2019-08-27 08:47:56 · 2978 阅读 · 1 评论 -
[LeetCode]1171. Remove Zero Sum Consecutive Nodes from Linked List
一、题意Given theheadof a linked list, we repeatedly delete consecutive sequences of nodes that sum to0until there are no such sequences.After doing so, return the head of the final linked list. ...原创 2019-08-26 21:45:33 · 536 阅读 · 0 评论 -
[leetcode]32. Longest Valid Parentheses
题目描述Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.样例Example 1:Input: “(()”Output: 2Explanation: The longest...原创 2019-07-29 19:19:40 · 191 阅读 · 0 评论 -
[leetcode]10. Regular Expression Matching
题目给定一个字符串 (s) 和一个字符模式 (p)。实现支持 '.' 和 '*' 的正则表达式匹配。'.' 匹配任意单个字符。'*' 匹配零个或多个前面的元素。匹配应该覆盖整个字符串 (s) ,而不是部分字符串。说明s 可能为空,且只包含从 a-z 的小写字母。 p 可能为空,且只包含从 a-z 的小写字母,以及字符 . 和 *。示例 输入:s = "aa"...原创 2018-12-17 20:29:02 · 186 阅读 · 0 评论 -
[leetcode]890. 查找和替换模式
题目你有一个单词列表 words 和一个模式 pattern,你想知道 words 中的哪些单词与模式匹配。如果存在字母的排列 p ,使得将模式中的每个字母 x 替换为 p(x) 之后,我们就得到了所需的单词,那么单词与模式是匹配的。(回想一下,字母的排列是从字母到字母的双射:每个字母映射到另一个字母,没有两个字母映射到同一个字母。)返回 words 中与给定模式匹配的单词列表。...原创 2018-08-19 19:47:48 · 886 阅读 · 0 评论 -
[leetcode]205. Isomorphic Strings 同构字符串
题目描述: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced wi...原创 2018-08-19 19:31:34 · 310 阅读 · 0 评论