leetcode validate binary nodes
LeetCode 39. 组合总和
``` class Solution { public: vector> res; vector> combinationSum(vector& candidates, int target) { dfs(candidates,0,target); return res; } vector path ......
【leetcode】21. Merge Two Sorted Lists
将两个升序链表合并为一个新的 **升序** 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:**  **输入:**l1 = \[1,2,4\] ......
Leetcode 2611. 老鼠和奶酪
### 题目: 有两只老鼠和 `n` 块不同类型的奶酪,每块奶酪都只能被其中一只老鼠吃掉。 下标为 `i` 处的奶酪被吃掉的得分为: - 如果第一只老鼠吃掉,则得分为 `reward1[i]` 。 - 如果第二只老鼠吃掉,则得分为 `reward2[i]` 。 给你一个正整数数组 `reward1` ......
window安装EMQX和node.js
1. 进入网站 https://www.emqx.io/zh/downloads?os=Windows  1. 进 ......
Node_学习笔记
不同技术点 : 24px 红色 加粗 标题一 技术点子模块 : 18px 黑色加粗 标题二 子模块在细分 : 16px 缩进 标题三 普通文字 : 14px NodeJS入门 NodeJS是什么 : Node.js 就是一款应用程序,是一款软件,它可以运行 JavaScript CDM常用命令 : ......
node实现文件上传到七牛云
使用七牛云提供的Node.js SDK(https://developer.qiniu.com/kodo/1289/nodejs)实现文件上传 服务端: 1、安装JDK npm/cnpm install qiniu or yarn add qiniu 2、导出七牛云配置文件的Token // 七牛云 ......
解决使用yarn安装依赖出现“The engine "node" is incompatible with this module. Expected version "^14.18.0 || ^16.14.0 || >=18.0.0". Got "17.9.0"”的问题
# 1、问题描述 某天在使用`yarn`安装依赖的时候,突然出现如下错误导致安装依赖终止: **The engine "node" is incompatible with this module. Expected version "^14.18.0 || ^16.14.0 || >=18.0.0 ......
上传文件异常:The temporary upload location [/tmp/tomcat.xxxxxxx/work/Tomcat/localhost/ROOT] is not valid
一个长久没更新过的spring boot项目突然间文件上传错误,异常信息如下,此原因主要问题是tomcat默认的临时目录没了,项目运行的服务器每隔一段时间会清除 /tmp 临时目录,项目每次启动都会创建临时目录,经常重启的项目不会有此问题。 解决方案: 1. 重启项目,每隔一段时间重启,可以跟 /t ......
自定义上传图片,动态拼接html元素,node插入/替换指定位置旧元素
<!DOCTYPE html> <head> <meta name="viewport" content="width=device-width,initial-scale=0.5,maximum-scale=1.0,minimum-scale=0.5,user-scalable=yes"> <ti ......
node笔记
使用淘宝镜像的命令:npm install -g cnpm --registry=https://registry.npmmirror.com cnpm install express npm install express # 本地安装 npm install express -g # 全局安装 ......
AtCoder Beginner Contest 149 F Surrounded Nodes
[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc149_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc149/tasks/abc149_f "AtCoder 传送门") 不错的题。 考虑题 ......
LeetCode----字典树
# 1 原理 [字典树原理参考](https://blog.csdn.net/m0_46202073/article/details/107253959) # 2 构建字典树 ```python class Trie: def __init__(self): # 字典树结构 # children 数 ......
Leetcode刷题指南
## 1. 数据结构 ### 1.1 数组 - **循环数组问题**:把数组扩大为两倍即可,但不是真的扩大两倍,而是通过索引取模的方式 ### 1.2 链表 链表可以通过引入虚拟头节点 `ListNode *dummy = new ListNode{-1, nullptr}` 来极大简化 0. ** ......
leetcode 17. 电话号码的字母组合
## 递归 自己写了个递归的算法 ```java class Solution { public List letterCombinations(String digits) { List resList = recursion(digits); return resList; } public L ......
Leetcode 2352. 相等行列对
### 题目: 给你一个下标从 `0` 开始、大小为 `n x n` 的整数矩阵 `grid` ,返回满足 `R~i~` 行和 `C~j~` 列相等的行列对 `($$R_i$$, C~j~)` 的数目。 如果行和列以相同的顺序包含相同的元素(即相等的数组),则认为二者是相等的。 ### 难度:简单 ......
拓扑错误:自交。jts.geom.TopologyException: found non-noded intersection between LINESTRING
That being said, you will want to ensure the geometries are valid before computing the intersection, using polygon1.isValid() and polygon2.isValid(). ......
Node.js常用库
`json-server`:json数据模拟,使用示例地址:https://blog.csdn.net/m0_62956518/article/details/124366111 `http`、`http-server`:基于node实现的http服务器 ......
leetcode 15. 三数之和
## 暴力法 暴力解法总是最直接能想到的解法。 ```java NA ``` ## 双指针法 贴一个评论区看到的解法 ```java class Solution { //定义三个指针,保证遍历数组中的每一个结果 //画图,解答 public List> threeSum(int[] nums) { ......
Leetcode Hot 100 & 49. Group Anagrams
写在前面: 不知不觉已经研二下了,既然选择以后走AI这条路,不可避免地也得刷一刷leetcode题目,因为招聘的时候笔试总是要用到的。首先刷一刷leetcode的hot 100题,好记性赶不上烂笔头,记录下来在写这些算法题中的收获给自己看。 参考资料: 考点:哈希 & [题干] 这题没做出来,第一次 ......
[LeetCode] 2352. Equal Row and Column Pairs
Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair is co ......
[LeetCode] 1347. Minimum Number of Steps to Make Two Strings Anagram 制造字母异位词的最小步骤数
You are given two strings of the same length `s` and `t`. In one step you can choose **any character** of `t` and replace it with **another character* ......
算法 in Go:Binary Search(二分查找)
# 算法 in Go:Binary Search(二分查找) ## Binary Search(二分查找) ### Binary Search(二分查找) - 猜数 - 1、2、3、4、5、6、7、8 - 排好序一个集合,先从中间开始猜,根据提示就可以排除一半,在剩余的一半里,再从中间开始猜,依此类 ......
leetcode-图论总结
此文总结一下常见图论算法,代码可以为后续遇见类似题目提供参考: 1. 图的表示: 邻接矩阵:可通过创建数组得到 邻接表:我个人喜欢通过LinkedList<int[]>[] graph = new LinkedList[n];得到。 Edge List:同样可以通过LinkedList<int[]> ......
使用Node.js搭建的微服务器基本流程
## 前言 使用Node.js搭建的微服务器, 处理注册登录操作的流程详解。主要包括注册,登录两大模块。 ## Node.js项目的搭建 ### 基于Express框架mongodb数据库搭建的Web服务器基本配置 **1. 初始化Node.js项目** `npm init` **2. 项目目录结构 ......
SpringMVC 国际化 Hibernate Validator 扩展注解
# 高版本 JDK Hibernate Validator 扩展注解 https://stackoverflow.com/questions/35986200/error-creating-bean-with-name-org-springframework-validation-beanvalid ......
Spring注解校验@Valid的手动调用
在做Spring项目的时候,@Valid可以完成优雅的参数校验,但是在不少特殊场景下,会有字段组合校验的场景.这种情况下,就需要在后台手动校验,那么如何在后端也优雅的参数校验,避免一堆判断和抛异常呢,可以试试在满足校验场景下手动触发@Valid校验. ### 1. 第一步:定义校验对象 点击查看代码 ......
leetcode-滑动窗口总结
滑动窗口是我在刷题时感觉比较困难的部分,简单做一个总结,防止之后又忘了: 一般模板如下: // 注意:java 代码由 chatGPT🤖 根据我的 cpp 代码翻译,旨在帮助不同背景的读者理解算法逻辑。 // 本代码还未经过力扣测试,仅供参考,如有疑惑,可以参照我写的 cpp 代码对比查看。 /* ......
Leetcode 2460. 对数组执行操作
### 题目: 给你一个下标从 **0** 开始的数组 `nums` ,数组大小为 `n` ,且由 **非负** 整数组成。 你需要对数组执行 `n - 1` 步操作,其中第 `i` 步操作(从 **0** 开始计数)要求对 `nums` 中第 `i` 个元素执行下述指令: - 如果 `nums[i ......
[LeetCode] 2460. Apply Operations to an Array
You are given a 0-indexed array nums of size n consisting of non-negative integers. You need to apply n - 1 operations to this array where, in the ith ......
LeetCode 669. 修剪二叉搜索树
#### 思路 - 遍历所有节点,如果当前节点不在所给区间里,删除该点;否则 - 如果该点要被删除,将其左右子树其中之一提上来即可 - 根节点位于左右子树取值区间的中间,如果该点要被删除,那么一定存在不满足要求的子树,不可能两棵子树同时保留 #### 代码 ```c class Solution { ......