随笔分类 -  LeetCode

用来记录LeetCode中的题解
[LeetCode] 九坤-03. 数字默契考验
摘要:一、题目 某数学兴趣小组有 N 位同学,编号为 0 ~ N-1,老师提议举行一个数字默契小测试:首先每位同学想出一个数字,按同学编号存于数组 numbers。每位同学可以选择将自己的数字进行放大操作,每次在以下操作中任选一种(放大操作不限次数,可以不操作): 将自己的数字乘以 2 将自己的数字乘以 阅读全文

posted @ 2022-08-22 20:59 刘好念 阅读(22) 评论(0) 推荐(0) 编辑

[LeetCode] 5933. k 镜像数字的和
摘要:本文介绍了一种求解LeetCode 5399的一种解法。通过模拟寻找十进制镜像数字,然后判断其对应的k进制表示是否也是镜像,直到得到n个镜像数字。 阅读全文

posted @ 2021-11-22 09:36 刘好念 阅读(248) 评论(0) 推荐(0) 编辑

[LeetCode] 2045. 到达目的地的第二短时间
摘要:本文介绍了一种使用BFS求解LeetCode第2045题的方法。 阅读全文

posted @ 2021-11-19 18:29 刘好念 阅读(180) 评论(0) 推荐(0) 编辑

[LeetCode]1278. Palindrome Partitioning III
摘要:一、题意 You are given a string s containing lowercase letters and an integer k. You need to : First, change some characters of s to other lowercase Engli 阅读全文

posted @ 2019-12-02 21:34 刘好念 阅读(2) 评论(0) 推荐(0) 编辑

[leetcode] 5182. Maximum Subarray Sum with One Deletion
摘要:一、题意 Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other wor 阅读全文

posted @ 2019-09-09 11:14 刘好念 阅读(2) 评论(0) 推荐(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 rearrange the substring s[left], ..., 阅读全文

posted @ 2019-09-01 17:52 刘好念 阅读(2) 评论(0) 推荐(0) 编辑

[leetcode]Leetcode中sort排序遇到的一些问题
摘要:转载自:https://www.cnblogs.com/flightless/p/10745318.html class Solution { public: static bool cmp(int a, int b){ return a>b; } int main(vector<int>& vec 阅读全文

posted @ 2019-08-27 08:47 刘好念 阅读(1) 评论(0) 推荐(0) 编辑

[LeetCode]1171. Remove Zero Sum Consecutive Nodes from Linked List
摘要:一、题意 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 阅读全文

posted @ 2019-08-26 21:45 刘好念 阅读(5) 评论(0) 推荐(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: 阅读全文

posted @ 2019-07-29 19:19 刘好念 阅读(2) 评论(0) 推荐(0) 编辑

[leetcode]10. Regular Expression Matching
摘要:题目 给定一个字符串 (s) 和一个字符模式 (p)。实现支持 '.' 和 '*' 的正则表达式匹配。 '.' 匹配任意单个字符。 '*' 匹配零个或多个前面的元素。 匹配应该覆盖整个字符串 (s) ,而不是部分字符串。 说明 s 可能为空,且只包含从 a-z 的小写字母。p 可能为空,且只包含从  阅读全文

posted @ 2018-12-17 20:29 刘好念 阅读(3) 评论(0) 推荐(0) 编辑

[leetcode]890. 查找和替换模式
摘要:题目 你有一个单词列表 words 和一个模式 pattern,你想知道 words 中的哪些单词与模式匹配。 如果存在字母的排列 p ,使得将模式中的每个字母 x 替换为 p(x) 之后,我们就得到了所需的单词,那么单词与模式是匹配的。 (回想一下,字母的排列是从字母到字母的双射:每个字母映射到另 阅读全文

posted @ 2018-08-19 19:47 刘好念 阅读(4) 评论(0) 推荐(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 occ 阅读全文

posted @ 2018-08-19 19:31 刘好念 阅读(3) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示