leetcode validate binary nodes
validate.js
校验金额 export const validateMoney = (rule, value, callback) => { if (value "") { return callback(new Error("不能为空")); } if (value <= 0) { return callback ......
[LeetCode] 1346. Check If N and Its Double Exist 检查整数及其两倍数是否存在
Given an array `arr` of integers, check if there exist two indices `i` and `j` such that : - `i != j` - `0 这道题给了一个整型数组,让检测是否有一个数字和其倍数同时存在的情况。一看到这道题博主就 ......
LeetCode 周赛 348(2023/06/05)数位 DP 模板学会了吗
> **本文已收录到 [AndroidFamily](https://github.com/pengxurui/AndroidFamily),技术和职场问题,请关注公众号 [彭旭锐] 加入知识星球提问!** - 往期回顾:[LeetCode 单周赛第 347 场 · 二维空间上的 LIS 最长递增子 ......
浏览器JS环境与Node.js环境
# 区别 浏览器环境和Node.js环境是两种不同的 JS 代码运行环境,它们在以下几个方面有所区别: 1. 运行平台:`JS浏览器环境` 指的是 JS 代码运行在用户电脑上的 Web浏览器中,而 `Node.js环境` 指的是 JS 代码运行在服务器或本地计算机上。 2. JavaScript A ......
node版本问题:Error: error:0308010C:digital envelope routines::unsupported
前言 出现这个错误是因为 node.js V17及以后版本中最近发布的OpenSSL3.0, 而OpenSSL3.0对允许算法和密钥大小增加了严格的限制,可能会对生态系统造成一些影响. 在node.js V17以前一些可以正常运行的的应用程序,但是在 V17 及以后版本可能会抛出以下异常: 我重装系 ......
node.js安装及环境配置教程【Windows系统安装包方式】
一、下载安装包: https://nodejs.org/zh-cn/download/ 注:根据自己电脑系统及位数选择,我的电脑是Windows系统、64位、想下载稳定版的.msi(LTS为长期稳定版)这里选择windows64位.msi格式安装包。 .msi和.zip格式区别: .msi是Wind ......
Leetcode 2517. 礼盒的最大甜蜜度
### 题目: 给你一个正整数数组 `price` ,其中 `price[i]` 表示第 `i` 类糖果的价格,另给你一个正整数 `k` 。 商店组合 `k` 类 不同 糖果打包成礼盒出售。礼盒的 **甜蜜度** 是礼盒中任意两种糖果 **价格** 绝对差的最小值。 返回礼盒的 **最大** 甜蜜度 ......
Leetcode 1156. 单字符重复子串的最大长度
### 题目: 如果字符串中的所有字符都相同,那么这个字符串是单字符重复的字符串。 给你一个字符串 `text`,你只能交换其中两个字符一次或者什么都不做,然后得到一些单字符重复的子串。返回其中最长的子串的长度。 ### 难度:中等 #### 示例1: ``` 输入:text = "ababa" 输 ......
LeetCode 450. 删除二叉搜索树中的节点
```c class Solution { public: TreeNode* deleteNode(TreeNode* root, int key) { del(root,key); return root; } void del(TreeNode* &root,int key) { if(!ro ......
LeetCode 538. 把二叉搜索树转换为累加树
```c class Solution { public: void dfs(TreeNode* root,int &sum)//从大到小遍历所有节点 { if(!root) return; dfs(root->right,sum); sum+=root->val; root->val=sum; d ......
[LeetCode] 1345. Jump Game IV 跳跃游戏之四
Given an array of integers `arr`, you are initially positioned at the first index of the array. In one step you can jump from index `i` to index: - `i ......
LeetCode 501. 二叉搜索树中的众数
``` class Solution { public: vector res; int cnt=0; int find(TreeNode* root,int val)//返回当前子树值为val的个数 { if(!root) return 0; return find(root->left,val) ......
使用 Node.js 连接 MySQL
## 概述 当使用 Node.js 开发 Web 应用程序时,经常需要与数据库进行交互来存储和检索数据。[MySQL](后端/MySQL.md) 是一个流行的关系型数据库管理系统,它提供了强大的功能和性能。本文将介绍如何使用Node.js连接MySQL数据库,并展示一些常见的操作示例。 ## 开始 ......
I/O密集型应用模型 数据密集型应用 Node对CPU密集型的场景不够友好
语雀 https://help.aliyun.com/document_detail/193189.html 更新时间:2022-11-28 18:16 产品详情 相关技术圈 我的收藏 本文介绍如何通过函数计算,解决语雀CPU密集场景下,进程被阻塞等问题。 客户介绍 语雀是一个专业的云端知识库,用于 ......
[LeetCode] 2101. Detonate the Maximum Bombs
You are given a list of bombs. The range of a bomb is defined as the area where its effect can be felt. This area is in the shape of a circle with the ......
LeetCode.螺旋矩阵问题
## LeetCode54 螺旋矩阵  ### 思路 就是说,**给我 ......
Ubantu使用n升级Node提示权限不够
升级Node时,常见以下问题: 1. 使用 `n stable` 时提示权限不够 ```bash (base) zibuyu@ubuntu:~/Desktop/luffy$ n stable installing : node-v18.16.0 mkdir : /usr/local/n/versio ......
leetcode2352哈希表的键可以是一个容器等类型
map<vector<int>,int>cnt;//用于存储每个行向量出现的次数 for(auto row:grid){//直接遍历行向量 cnt[row]++; } for(int i=0;i<n;++i){ vector<int>arr; for(int j=0;j<n;++j){//存储列向量 ......
leetcode2352二维vector的操作
对于二维vector有分外层和内层: 当初始化指定了外层大小(行数)时,添加元素写法: 错误写法:不能使用[] vector<vector<int>>v(3);//指定外层数目 for(int i=0;i<3;++i){ for(int j=0;j<n;++j){ v[i][j]=0; } } 正确 ......
Leetcode 2559. 统计范围内的元音字符串数
### 题目: 给你一个下标从 `0` 开始的字符串数组 `words` 以及一个二维整数数组 `queries` 。 每个查询 `queries[i] = [l, r]` 会要求我们统计在 `words` 中下标在 `l` 到 `r` 范围内(包含 这两个值)并且以元音开头和结尾的字符串的数目。 ......
leetcode 1393 股票的资本损益
leetcode 1393 股票的资本损益 select p1.stock_name, (p2.price - p1.price) as capital_gain_loss from ( select s1.stock_name, s1.operation, sum(s1.price) as pri ......
pip install中的--no-binary :all:含义
`--no-binary :all:` 是 pip 命令的一个选项,用于指示 pip 在安装包时不使用预编译的二进制文件,而是从源代码进行安装。 具体来说,该选项有以下含义:- `--no-binary`: 这是 `install` 子命令的选项之一,用于指示 pip 在安装包时禁用预编译的二进制文 ......
LeetCode 236_ 二叉树的最近公共祖先
```c class Solution { public: vector path1,path2; bool dfs(TreeNode* root,TreeNode* p,vector& path) { if(!root) return false; if(root==p||dfs(root->le ......
LeetCode235. 二叉搜索树的最近公共祖先
```c class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { if(p->valval&&q->valval) return lowestCommonA ......
leetcode 1341 电影评分
leetcode 1341 电影评分 ( select u1.name as results from Users u1 left join( select mr1.user_id, count(mr1.rating) as c1 from MovieRating as mr1 group by m ......
[LeetCode] 2559. Count Vowel Strings in Ranges
You are given a 0-indexed array of strings words and a 2D array of integers queries. Each query queries[i] = [li, ri] asks us to find the number of st ......
node.js安装
F:\Program Files\nodejs\ windows安装npm教程(nodejs) [就是参照这个编辑安装] https://www.cnblogs.com/kakashi-feng/p/16483727.html npm 安装详细教程 https://blog.csdn.net/cle ......
Linux 系统升级node18
解决/lib64/libc.so.6: version GLIBC_2.28‘ not found 解决方案: 升级glibc到2.28版本 wget https://mirror.bjtu.edu.cn/gnu/libc/glibc-2.28.tar.xz tar -xf glibc-2.28.t ......
MongoDB 大文件处理 _ Building MongoDB Applications with Binary Files Using GridFS
https://www.mongodb.com/docs/manual/core/gridfs/?_ga=2.14656884.2104711149.1685609332-621414559.1685004986 GridFS GridFS is a specification for storin ......