总和leetcode 39
[LeetCode] 2337. Move Pieces to Obtain a String
You are given two strings start and target, both of length n. Each string consists only of the characters 'L', 'R', and '_' where: The characters 'L' ......
第 111 场双周赛 - 力扣(LeetCode)
# [第 111 场双周赛 - 力扣(LeetCode)](https://leetcode.cn/contest/biweekly-contest-111/) ## [2824. 统计和小于目标的下标对数目 - 力扣(LeetCode)](https://leetcode.cn/problems/ ......
[Leetcode Weekly Contest]359
链接:[LeetCode](https://leetcode-cn.com/contest/weekly-contest-359/) ## [Leetcode]2828. 判别首字母缩略词 给你一个字符串数组 words 和一个字符串 s ,请你判断 s 是不是 words 的 首字母缩略词 。 如 ......
LeetCode day 1
class Solution { public: vector<int> sortArrayByParityII(vector<int>& nums) { int n = nums.size(); vector<int> even; // 存储偶数 vector<int> odd; // 存储奇数 ......
leetcode
# 最长回文子串 class Solution: def longestPalindrome(self, s: str) -> str: return self.manacher(s) @staticmethod def manacher(s: str) -> str: # 如果s是单字符的字符串, ......
Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range
在使用浏览器内置API btoa() 编码base64时: 报错Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range 报错信息解释: ......
Leetcode 59. 螺旋矩阵 II && 剑指 Offer 29. 顺时针打印矩阵
这两个题非常相似,但是前者较为简单,后者较难。 由于前者访问的矩阵是方阵,因此可以通过迭代去做(因为方阵每次迭代,长和宽缩水的大小是一样的,但是矩阵不可以,因为矩阵最后一次迭代,长和宽的缩水不一定一样) class Solution { public: vector<vector<int>> gen ......
运行 'RuoYiApplication' 时出错: 模块 'ruoyi-admin' 没有 JDK
项目运行良好,关机重新打开项目时出现 “运行 'RuoYiApplication' 时出错: 模块 'ruoyi-admin' 没有 JDK”导致运行失败,经检查项目中已经配置SDK 解决办法:重新加载Maven,或者直接点项目右侧的刷新按钮 ......
解决python错误 UnicodeDecodeError: 'gb2312' codec can't decode byte 0x8b in position 1: illegal multibyt
报错的代码: url= 'http://kaijiang.500.com/shtml/ssq/19001.shtml' page =urllib.request.urlopen(url) content = page.read().decode('gb2312') 报这个错的原因是获取到的网页内容是 ......
LeetCode -- 777. 在LR字符串中交换相邻字符
给两种不同元素,可以和第三种元素交换位置,L只能向左走,R只能向右走,问start数组可否经过某些变换变换到end。 经典双指针算法。 class Solution { public: bool canTransform(string start, string end) { int n = sta ......
Leetcode 242. 有效的字母异位词(Valid anagram)
[题目链接🔗](https://leetcode.cn/problems/valid-anagram) 给定两个字符串s和t, 编写一个函数来判断t是否是s的字母异位词. 注意: 若s和t中每个字符出现的次数都相同, 则称s和t互为字母异位词. 示例 1: ``` 输入: s = "anagram ......
LeetCode 周赛上分之旅 #41 结合离散化的线性 DP 问题
> ⭐️ **本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 \[彭旭锐] 和 [BaguTree Pro](https://www.mdnice.com/writing/85b28c4e60354865a423728e668fc570) 知识星球提问。** > > 学习数据 ......
LeetCode —— 二分查找
33. 搜索旋转排序数组 翻转点在前半部分 nums[mid]<=nums[low] 而后半部分是单调递增的,比较好判断。可以判断 nums[mid] < target <= nums[high] 去后半部分 else 去后半部分 翻转点在后半部分 nums[mid]<=nums[low] 而前半部 ......
Cause: java.sql.SQLException: Field 'id' doesn't have a default value Field 'id' doesn't have a default value; nested exception is java.sql.SQLException: Field 'id' doesn't have a default value
报错内容: 是因为实体类文件中设置主键自增的类型不对导致的,建议再温习一下逐渐自增的类型以及使用方式 我自己的实体类里面设置的IdType为auto,但是主键id是char类型的,还不是int数值类型,所以无法设置为自增 这里需要换成 IdType.ID_WORKER_STR @ApiModelPr ......
39 pinctrol(五)pinctrl client于pinctrl driver联系
## 前言 整体结构  ## 1. pinctrl dirver于pinctrl client platform\ ......
2023-08-20:用go语言写算法。给定一个由'W'、'A'、'S'、'D'四种字符组成的字符串,长度一定是4的倍数, 你可以把任意连续的一段子串,变成'W'、'A'、'S'、'D'组成的随意状
2023-08-20:用go语言写算法。给定一个由'W'、'A'、'S'、'D'四种字符组成的字符串,长度一定是4的倍数, 你可以把任意连续的一段子串,变成'W'、'A'、'S'、'D'组成的随意状态, 目的是让4种字符词频一样。 返回需要修改的最短子串长度。 完美走位问题。 输入:s = "QQQ ......
LeetCode 周赛上分之旅 #40 结合特征压缩的数位 DP 问题
> ⭐️ **本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 \[彭旭锐] 和 [BaguTree Pro](https://www.mdnice.com/writing/85b28c4e60354865a423728e668fc570) 知识星球提问。** > > 学习数据 ......
ffpyplayer源码编译报错:ffpyplayer/tools.pyx:182:28: Cannot assign type 'void (*)(void *, int, const char *, va_list) except * nogil' to 'void (*)(void *, int, const char *, va_list) noexcept nogil'
编译ffpyplayer报错,具体错误如标题。 报错信息: ffpyplayer/tools.pyx:182:28: Cannot assign type 'void (*)(void *, int, const char *, va_list) except * nogil' to 'void ( ......
LeetCode -- 第 359 场周赛
本题我们只需要将所有首字母取出来,并与s比较即可。 class Solution { public: bool isAcronym(vector<string>& words, string s) { string res; for(auto &it: words) { res += it[0]; ......
IDEA 刷题工具 leetcode editor
突然有一天不好用了,然后抓取新的 cookie 后也登陆不上 https://github.com/shuzijun/leetcode-editor/issues/402 
解决办法: 在<script> 中,加上属性type="module" <script src="../js/home.js" type="module"></script> <script src="../js/home.js" type="module"></script> ......
【leetcode】剑指-68.1 二叉搜索树的最近公共祖先
## 思路 首先保证传入的p.valroot.val`: goto right tree ## 代码 第一版,递归法 ``` class Solution { public: TreeNode* get_ancestor(TreeNode* root, TreeNode* p, TreeNode* ......
leetcode2235 两整数相加
题目描述:(这第一种方法我就不多说了,肯定是有手就行) 给你两个整数 num1 和 num2,返回这两个整数的和。 示例 1: 输入:num1 = 12, num2 = 5 输出:17 解释:num1 是 12,num2 是 5 ,它们的和是 12 + 5 = 17 ,因此返回 17 。 示例 2: ......
Leetcode 146 LRUCache
```c /* * * Copyright (C) 2023-08-18 13:51 zxinlog * */ #include #define N 1000 // 普通Node typedef struct Node { int key; int value; struct Node *prev; ......
AtCoder Beginner Contest 288 - C Don't be cycle 删除图中最少的边使得图中无环
# [C - Don't be cycle](https://atcoder.jp/contests/abc288/tasks/abc288_c) **题意** 给定一个 n 个顶点,m 条边的无向图,你需要删除图中的一些边使得图中不存在环 问你需要删除的最少边数? **思路** 考虑连通块的生成树 ......
【LeetCode1384. 按年度列出销售总额】MySQL使用with recursive根据开始日期和结束日期展开为多行
# 题目地址 https://leetcode.cn/problems/total-sales-amount-by-year/description/ # 代码 ``` WITH RECURSIVE DateSeries AS ( SELECT product_id, period_start AS ......
【LeetCode2199. 找到每篇文章的主题】字符串处理题,使用MySQL里的group_concat和LOCATE函数完成
# 题目地址 https://leetcode.cn/problems/finding-the-topic-of-each-post/description/ # 代码 ``` with t1 as( select p.*, k.* from Posts p left join Keywords k ......