总和leetcode 39
【11月LeetCode组队打卡】Task5--UnionFind
并查集 UnionFind 一种树型的数据结构,用于处理一些不交集(Disjoint Sets)的合并及查询问题 联通子图 最小生成树Kruskal算法 最近公共祖先LCA 不交集:没有重复元素的集合 合并Union:二变一 查询Find:确定元素所属集合,通常返回集合内的一个代表元素 实现思路 基 ......
Leetcode 373周赛
周赛链接:https://leetcode.cn/contest/weekly-contest-373/ 100139. 循环移位后的矩阵相似检查 不需要判断奇数还是偶数,题目要求最后两个矩阵是否相同,那么向左循环移动和向右循环移动意义是一样的 奇数行右移k次,$$a[i]==a[(i + k) % ......
Reference and inspiration from China's strategy for addressing water pollution issues in Africa
According to China's three line one permit measures, we believe that this has a certain reference value for water pollution issues in Africa. The "thr ......
leetcode hot100-03 移动零
移动零 地址:https://leetcode.cn/classic/problems/move-zeroes/description/ 难点: 在原数组的基础上进行移动 保持相对顺序思考过程: 思考过程: 一开始没有考虑顺序的问题 记录最后一个不是0的位置 从左遍历数据 如果为0 则将数据与最后一 ......
LeetCode 354. (经典问题) 俄罗斯套娃信封问题 (俄罗斯套娃模型 + 最长下降子序列
package leetcode; import java.util.Arrays; public class lec154 { /** * 首先是思路来源 : https://leetcode.cn/problems/russian-doll-envelopes/solutions/19681/z ......
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/llama-2-7b-chat-hf-chinese/1.1'. Use `repo_type` argument if needed.
问题: 2023-11-26 07:45:38 | ERROR | stderr | raise HFValidationError(2023-11-26 07:45:38 | ERROR | stderr | huggingface_hub.utils._validators.HFValidati ......
pip install报错"Can't connect to HTTPS URL because the SSL module is not available"
pip时install报错 一、故障现象 [root@jenkins /data/package/openssl-1.1.1n]# pip3 install emoji WARNING: pip is configured with locations that require TLS/SSL, h ......
office the language DLL 'VBE7INTL.DLL' is not be found
其实是缺少vba,安装组件就可以了 解决方案:在卸载程序的面板中,找到office,右键选择更改,选择添加或删除功能,勾选如下两项就可以了 记得关掉office后再打开就好了 ......
[LeetCode] 1424. Diagonal Traverse II
Given a 2D integer array nums, return all elements of nums in diagonal order as shown in the below images. Example 1: Input: nums = [[1,2,3],[4,5,6],[ ......
【11月LeetCode组队打卡】Task4--BinarySearchTree
Review 有数值 有序树:lch< root< rch 递归和迭代遍历不同于普通二叉树 搜索BST 700.二叉搜索树中的搜索 有:返回以存储val节点为根的子树 无:NULL AC1:递归 参数和返回值: 根节点 & 待寻值 节点 终止条件:根为空||匹配到val 单层逻辑: 有序树:从左到右 ......
CF685E Travelling Through the Snow Queen's Kingdom
题意 给定一张图,走出当前边的时间为 \(i\)。 \(q\) 次询问,问 \(s\) 是否能在 \(l \to r\) 中走到 \(t\)。 Sol 考虑将边从大到小插入图中。 注意到当前边只能对起点造成贡献。 复杂度 \(O(n \times \max\{n, m\})\) Code #incl ......
LeetCode二叉树小题目
Q1将有序数组转换为二叉搜索树 题目大致意思就是从一个数组建立平衡的二叉搜索树。由于数组以及进行了升序处理,我们只要考虑好怎么做到平衡的。平衡意味着左右子树的高度差不能大于1。由此我们可以想着是否能用类似二分+递归来解决。 如果left>right,直接返回nullpter 否则 mid = (le ......
MySQL将'20231124'转换为'yyyy/MM/dd'格式
可以使用STR_TO_DATE函数将一个字符串转换为日期,并使用DATE_FORMAT函数将日期格式化为指定的格式 SELECT DATE_FORMAT(STR_TO_DATE('20231124', '%Y%m%d'), '%Y/%m/%d'); 解释一下上述语句的步骤: STR_TO_DATE( ......
mysql5.0升级8.0完成后,服务器重启引发"#1449 - The user specified as a definer ('mysql.infoschema'@'localhost') does not exist"异常小结
遇到的问题: 问题一:ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist 异常原因:未知 解决办法: 验证指定的用户('mysql.infoschema ......
报错 ImportError: cannot import name 'Celery' from partially initialized module 'celery'
# 目录结构问题 原来目录结构: 改为: 把check_result produce_task拿出来 ......
[LeetCode] 1630. Arithmetic Subarrays
A sequence of numbers is called arithmetic if it consists of at least two elements, and the difference between every two consecutive elements is the s ......
[LeetCode] 2563. Count the Number of Fair Pairs
Given a 0-indexed integer array nums of size n and two integers lower and upper, return the number of fair pairs. A pair (i, j) is fair if: 0 <= i < j ......
[LeetCode] 2824. Count Pairs Whose Sum is Less than Target
Given a 0-indexed integer array nums of length n and an integer target, return the number of pairs (i, j) where 0 <= i < j < n and nums[i] + nums[j] < ......
解决POST表单提交报错 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported
百度发现 application/x-www-form-urlencoded;charset=UTF-8 是以键值对拼接的形式,即前端传过来的是键值对形式 前端代码:底层使用的vue中的axios发送的请求 import request from '@/utils/request' export d ......
您可以尝试添加 --skip-broken 选项来解决该问题 ** 发现 2 个已存在的 RPM 数据库问题, 'yum check' 输出如下: 2:postfix-2.10.1-9.el7.x86_64 有缺少的需求 libmy
##提示如下** Found 2 pre-existing rpmdb problem(s), ‘yum check’ output follows: 2:postfix-2.10.1-7.el7.x86_64 has missing requires of libmysqlclient.so.18 ......
【11月LeetCode组队打卡】Task3--RreductionOfBinaryTree
二叉树的还原 已知中序&前/后序列,可以唯一的确定这颗二叉树 105.从前序和中序遍历序列构造二叉树 < unordered_map > key:节点值 val:中序遍历序列位置 AC:leetcode官解--递归 class Solution { private: unordered_map<in ......
[LeetCode] 1410. HTML Entity Parser
HTML entity parser is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself. The sp ......
LeetCode之二叉树
发现新天地,欢迎访问Cr不是铬的个人网站 平衡二叉树 做这一道题目我们要考虑到平衡二叉树的定义。也就是一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1 。 关于一个结点的高度计算我们很容易用递归得出,那么我们用递归遍历加上这个判断条件即可. class Solution { public ......
mujoco安装报错:mujoco_py/cymj.pyx:67:5: Exception check on 'c_warning_callback' will always require the GIL to be acquired.
参考: https://blog.csdn.net/weixin_49373427/article/details/131981583 https://blog.csdn.net/CCCDeric/article/details/131788795 安装mujoco报错: 环境: python3.1 ......
Linux系统奇安信浏览器报错跨域:the resource is in more-private address space 'local'
报错: Access to XMLHttpRequest at "123" from origin "456" has been blocked by CORS policy:the request client is not a secure context and the resource is ......
【11月LeetCode组队打卡】Task3--BinaryTree
树 基本术语: 节点的度: 叶子节点=0 分支节点:含有的子树个数 节点关系: 父,子,兄 节点层次: 根节点:1 floor 路径:两节点间经过的节点序列 路径长度:路径上的边数 树的分类: 节点子树是否可以互换位置: 有序树:从左到右各子树依次有序(不能互换 无序树 二叉树 基本理论 定义1: ......
ModuleNotFoundError: No module named 'pip._vendor.progress'
出现异常: root@linaro-alip:/data/FantClient# ./venv_py39_rk/bin/python3 -m pip install qrcode -i https://mirrors.aliyun.com/pypi/simple Traceback (most re ......
[951] Understanding the pattern of "(.*?)" in Python's re package
In Python's regular expressions, (.*?) is a capturing group with a non-greedy quantifier. Let's break down the components: ( and ): Parentheses are us ......
39个你需要知道的Git命令
在本文中,我整理了一些常用的Git命令,希望这些命令可以帮助你提升工作效率。 初始化本地 Git 存储库 git init 克隆公共存储库 git clone repo_url 克隆私有仓库 git clone ssh://git@github.com/[username]/[repository- ......
UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??=' 报错处理
在用vite创建react的时候 install完成后输入pnpm run dev 突然蹦出 UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token '??=' 一脸闷逼,百度了一下。哦吼, 逻辑空赋值(??=)是ES2021的 ......