总和leetcode 39
LeetCode做题笔记
LeetCode做题笔记 3. 无重复字符的最长子串 最核心的就是维护一个字符串区间,同时保证其中的每个字符都只出现过一次。最最最暴力的就是枚举可能出现的每个字符串区间,然后确保里边元素不重复,然后找出最长的字符串有多少元素。再进一步的想法就是由小到大的构建这样的字符串。用双指针滑动窗口的思想来维护 ......
LeetCode 热题 100 之 56. 合并区间
# 题目 以数组 intervals 表示若干个区间的集合,其中单个区间为 intervals[i] = [starti, endi] 。请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。 **示例 1:** 输入:intervals = [[1,3],[2, ......
Leetcode448. 找到所有数组中消失的数字
``` class Solution { public: vector findDisappearedNumbers(vector& nums) { vector res; int n=nums.size(),offset=n+1; for(auto &num:nums) { int x=(num) ......
python 问题from mysql import connector ModuleNotFoundError: No module named 'mysql'
python 问题: from mysql import connector ModuleNotFoundError: No module named 'mysql' 不能pip installl mysql不起任何作用 正确做法:pip install mysql-connector-python ......
[LeetCode] 486. Predict the Winner
You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2. Player 1 and player 2 take turns, with pla ......
apue.3e遇到的编译问题(recipe for target 'badexit2' failed)以及ls1.c案例测试
APUE( 慢慢啃这本书)编译问题,网上获得的前辈方法,本地测试可行,仅作记录。 1.系统环境  2.下载解压 > ......
代码随想录算法训练营第三天| LeetCode 203.移除链表元素(同时也对整个单链表进行增删改查操作) 707.设计链表 206.反转链表
203.移除链表元素 题目链接/文章讲解/视频讲解::https://programmercarl.com/0203.%E7%A7%BB%E9%99%A4%E9%93%BE%E8%A1%A8%E5%85%83%E7%B4%A0.html 卡哥题目建议:本题最关键是要理解虚拟头结点的使用技巧,这个对链 ......
LeetCode 239. Sliding Window Maximum 单调队列
You are given an array of integers `nums`, there is a sliding window of size `k` which is moving from the very left of the array to the very right. Yo ......
【题解】[2023牛客多校] Qu'est-ce Que C'est?
题目传送门:[[2023牛客多校] Qu'est-ce Que C'est?](https://ac.nowcoder.com/acm/contest/57358/J) # 题意 给定 $n,m$ 构造 $a_{1},a_{2},...,a_{n}$, 其中 $a_{i} \in [-m, m]$ ......
.NET Core|--SkiaSharp 生成图像报错|--The type initializer for 'SkiaSharp.SKAbstractManagedStream' threw an exception.
### 前言 ```bash #SkiaSharp - 版本 2.88.3 #SkiaSharp.NativeAssets.Linux.NoDependencies - 版本 2.88.3 #部署服务器环境 Linux / docker / #Visual Studio 版本 Microsoft V ......
Leetcode438. 找到字符串中所有字母异位词
``` class Solution { public: vector findAnagrams(string s, string p) { unordered_map window,hash; vector res; for(auto i:p) hash[i]++; for(int i=0,j=0 ......
POJ1904 King's Quest
## [$POJ1904$ $King's$ $Quest$](http://poj.org/problem?id=1904) ### 一、题目描述 有$n$个王子,每个王子都有$k$个喜欢的妹子,每个王子只能和喜欢的妹子结婚。现有一个匹配表,将每个王子都与一个自己喜欢的妹子配对。请你根据这个表得出 ......
代码随想录算法训练营第二天| LeetCode 977.有序数组的平方 ,209.长度最小的子数组 ,59.螺旋矩阵II
977.有序数组的平方 题目链接:https://leetcode.cn/problems/squares-of-a-sorted-array/ 文章讲解:https://programmercarl.com/0977.%E6%9C%89%E5%BA%8F%E6%95%B0%E7%BB%84%E7% ......
windows安装xadmin==0.6.1报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 3444: illegal multibyte sequence
直接用pip安装xadmin会报以下错误: pip install xadmin==0.6.1 报错: Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<s ......
mysql启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)
mysql启动报错:ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061) netstat -ano | findstr 3306 ,检查端口3306上是否有进程运行(或直接检查任务管理器中的进程), ......
Pyinstaller打包Pyro4为啥总是报:serializer 'json' is unknown or not available
### 现象描述: 在使用Pyro4时,当需要将其打包成exe运行时,总是遇到:Pyro4.errors.SerializeError: serializer 'json' is unknown or not available 的错误提示; 但是当我们直接使用 python xxxx.py 运行或 ......
Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported]
@RequestParam用来处理 Content-Type 为 application/x-www-form-urlencoded 编码的内容,Content-Type默认为该属性。 可以用于接收URL中的参数并捆绑到方法的参数中,也可以接受post请求体中的Content-Type 为 appl ......
运行 'Tomcat 8.5.31' 出错: 无法打开调试器端口 (127.0.0.1:62511): java.net.SocketException "Interrupted function call: accept failed"
多个中间件占用一个端口,修改端口 ......
Docker不能启动,ERROR: ZONE_CONFLICT: 'docker0' already bound to a zone
Docker服务意外停止,想要重启Docker服务时,却遇到了 ERROR: ZONE_CONFLICT: 'docker0' already bound to a zone 的错误,解决方案如下: https://stackoverflow.com/questions/67497455/faile ......
帝国CMS Table '***.phome_ecms_news_data_'doesn't exist
解决办法 delete from `phome_ecms_news_index` where id not in(select id from phome_ecms_news) ......
rabbitmq告警Error: health check failed. Message: resource alarm(s) in effect:[{resource_limit,memory,'rabbit@rabbitmq-1'}]
这个错误信息表示 RabbitMQ 的内存使用量超出了预设的阈值,导致触发了 RabbitMQ 的内存警告阈值报警。 RabbitMQ 在运行过程中会不断地将消息存储在内存中,如果内存使用量超出了预设的阈值,就会触发内存警告阈值报警。这个阈值的默认值是 40% 的物理内存,可以通过修改 Rabbit ......
jenkins报错:Error: Cannot find module '/root/.jenkins/workspace/test/node_modules/ejs/postinstall.js'
+ npm install > core-js@3.31.1 postinstall /root/.jenkins/workspace/test-allsaintsmusic-html/node_modules/core-js > node -e "try{require('./postinstal ......
[LeetCode] 1870. Minimum Speed to Arrive on Time
You are given a floating-point number hour, representing the amount of time you have to reach the office. To commute to the office, you must take n tr ......
在 Windows 系统上,使用 Certbot 生成 Let's Encrypt 的泛域名证书
https://www.cnblogs.com/liucai/p/17460451.html https://zhuanlan.zhihu.com/p/627526278 在 Windows 系统上,你可以使用 Certbot 生成 Let's Encrypt 的泛域名证书。以下是具体步骤 软件准备 ......
Exception: Not found: 'python/cv2/py.typed'
Copying files from CMake outputcreating directory _skbuild/linux-x86_64-3.6/cmake-install/cv2copying _skbuild/linux-x86_64-3.6/cmake-install/python/cv ......
linux strings 用法,解决类似libstdc++.so.6: version `CXXABI_1.3.11'问题
参考https://blog.csdn.net/Aliven888/article/details/122428668 ``` ./bin/horizon: /usr/lib/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by ......
代码随想录算法训练营第一天| LeetCode 704. 二分查找、LeetCode 27. 移除元素
704. 二分查找 题目链接:https://leetcode.cn/problems/binary-search/ 视频链接:https://www.bilibili.com/video/BV1fA4y1o715 文章讲解:https://programmercarl.com/0704.%E4%B ......
format='%y-%m-%d'
format='%y-%m-%d' 和 format='%Y-%m-%d' 是日期格式化字符串中的两种不同的格式符。 format='%y-%m-%d' 中的 "%y" 表示年份的后两位数字(例如:21 表示 2021年),"%m" 表示月份,"%d" 表示日期。这样的格式化字符串会将日期格式化成类 ......
'GridViewDeletedEventArgs '末包含' RowIndex "的定义,并且找不到可接受第一 个"GridViewDeletedEventArgs类型参数的扩展方法RowIndex "(是否缺少using指令或程序集引用?)
页面中设置了“ OnRowDeleting="List_RowDeleting" DataKeyNames="id"”后台代码为:行 178: protected void List_RowDeleting(object sender, GridViewDeletedEventArgs e)行 17 ......
LeetCode 560. 和为 K 的子数组
``` class Solution { public: int subarraySum(vector& nums, int k) { int n=nums.size(),res=0; vector s(n+1,0); unordered_map hash;//记录端点i之前所有前缀和的出现情况 f ......