leetcode validate binary nodes
web | 在node中使用axios进行同步和异步请求
# web | 在node中使用axios进行同步和异步请求 最近在看怎么用nodejs整爬虫,摸索一下axios的使用。 ```js const axios = require('axios'); // 异步写法 axios("https://mz1.top") .then(res=>{ cons ......
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 ......
代码随想录算法训练营第一天| LeetCode 704. 二分查找、LeetCode 27. 移除元素
704. 二分查找 题目链接:https://leetcode.cn/problems/binary-search/ 视频链接:https://www.bilibili.com/video/BV1fA4y1o715 文章讲解:https://programmercarl.com/0704.%E4%B ......
npm ERR! `perfix` is not a valid npm option
全局路径cmd命令:npm config set perfix "D:\Program Files\nodejs\node_global" 缓存路径cmd命令:npm config set cache"D:\Program Files\nodejs\node_cache" 在注册nodejs全局路径 ......
Schema-validation: wrong column type encountered in column [NAME] in table [BUS]; found [nvarchar2 (Types#NVARCHAR)], but expecting [varchar2(255 char) (Types#VARCHAR)]
属性的类型出错 NVARCHAR 和 VARCHAR 不同 @Column(name = "NAME", columnDefinition = "nvarchar2(50)") private String name; ......
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 ......
Leetcode437. 路径总和 III
``` /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), ......
递归实现对TreeView的Node的填充
树的数据结构是从根节点开枝散叶,父节点唯一。 首先初始化要展示的数据,用Dictionary保存: Dictionary<int, List<int>> dt; 初始化数据,数字0为根节点,字典中的key有[0,1,2,3,4,11,12,13,14,21,22,23,24,31,32,33,34, ......
[LeetCode] 2013. Detect Squares
You are given a stream of points on the X-Y plane. Design an algorithm that: Adds new points from the stream into a data structure. Duplicate points a ......
React Native热更新报错:The "CFBundleShortVersionString" key in the "ios/***/Info.plist" file needs to specify a valid semver string
React Native项目集成了CodePush热更新,在用cpcn-client工具发布新版本时,在日志栏中打印了如下错误: Detecting ios app version: The "CFBundleShortVersionString" key in the "ios/xxx/Info. ......
go刷题Leetcode,生成文件夹与go文件模板
## go生成文件夹与模板 ### 起因 以前是用C/C++刷Leetcode时,将多个C/CPP文件放在同一个目录下,没有出任何问题,但是换成Go语言刷题。 在一个目录下创建多个go文件,每个文件都是以下 ```go package main func main(){ } ``` 在vscode下 ......
leetcode1448好节点深刻理解DFS+BFS
DFS 没有返回值 max在递归时要慎重用引用,因为在回溯时可能不能改变max; 因为节点的值可能有负数,所以最大值从根节点开始,根节点一定是好节点。 int goodNum=0; void dfs(TreNode* root,int max){ if(!root)return ; if(root- ......
LeetCode 热题 100 之 53. 最大子数组和
# 题目 给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 子数组 是数组中的一个连续部分。 **示例 1:** 输入:nums = [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的和最大, ......
cdh node扩容
参考:https://blog.csdn.net/xiaoweite1/article/details/123919740 # hostname修改 hostnamectl set-hostname bpit64 # ssh免密认证 。。。略 # /etc/hosts修改 10.5.250.56 b ......
LeetCode 406. 根据身高重建队列
``` class Solution { public: struct node { int val; int pre; node* next; node(int a,int b,node* c) { val=a; pre=b; next=c; } }; void insert(node* &hea ......
Node脚本对象
编辑 Node对象:包含脚本编写,点击对象在Script界面中进行编程 对Node上面右键点击: * [导出script]脚本和[导出]对象,以实现 对象的保存/复用 * 引用:选择一个被引用的对象, 在需要引用的对象上面 右键/设置引用 那么 就会复用 被引用对象的script, 当更新被引 ......
[LeetCode] 2208. Minimum Operations to Halve Array Sum
You are given an array nums of positive integers. In one operation, you can choose any number from nums and reduce it to exactly half the number. (Not ......
leetcode第354场周赛 2 - 双指针
[题目传送门](https://leetcode.cn/contest/weekly-contest-354/) # [2779. 数组的最大美丽值](https://leetcode.cn/problems/maximum-beauty-of-an-array-after-applying-ope ......
LeetCode 热题 100 之 21. 合并两个有序链表
# 题目 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:** 输入:l1 = [1,2,4], l2 = [1,3,4] 输出:[1,1,2,3,4,4] **示例 2:** 输入:l1 = [], l2 = [] 输出:[] **示 ......
LeetCode 热题 100 之 560. 和为 K 的子数组.md
# 题目 给你一个整数数组 nums 和一个整数 k ,请你统计并返回 该数组中和为 k 的连续子数组的个数 。 **示例 1:** 输入:nums = [1,1,1], k = 2 输出:2 **示例 2:** 输入:nums = [1,2,3], k = 3 输出:2 **提示:** 1 int ......
React Native集成CodePush热更新遇到的坑,以及折腾过程。"CFBundleShortVersionString" key needs to specify a valid semver string
最近开始一个React Native的新项目。按惯例,在创建完项目后,先集成CodePush热更新功能。 这种活已经干过不止一两次了,当然没啥问题,直接上手开干。 可问题恰恰出在了本以为应该很顺利的地方。 首先,在用 cpcn-client 工具给项目安装 cpcn-react-native 包时, ......
[Leetcode Weekly Contest]355
链接:[LeetCode](https://leetcode-cn.com/contest/weekly-contest-355/) ## [Leetcode]6921. 按分隔符拆分字符串 给你一个字符串数组 words 和一个字符 separator ,请你按 separator 拆分 word ......
master和node的ip发生变化
之前部署k8s的时候用的dhcp自动获取ip,因为服务器常年不关,所以也没绑定静态ip 某天公司停电,导致服务器重启后我的机器也重启 原ip已经被其他机器抢占 但是k8s的各种服务配置都使用的固定老的ip 因此,就需要重新设置集群服务器的ip 最初我是手动修改的各个配置文件中旧的IP,发现不行,因为 ......
把Pod分配到node上
### 分配Pod到node #### 给node打上标签 `kubectl label nodes disktype=ssd` #### 查看标签 `kubectl get nodes --show-labels` #### 根据标签分配node ```yaml apiVersion: v1 ki ......
LeetCode 热题 100 之 438. 找到字符串中所有字母异位词
# 题目 给定两个字符串 s 和 p,找到 s 中所有 p 的 异位词 的子串,返回这些子串的起始索引。不考虑答案输出的顺序。 异位词 指由相同字母重排列形成的字符串(包括相同的字符串)。 **示例 1:** 输入: s = "cbaebabacd", p = "abc" 输出: [0,6] 解释: ......
LeetCode 热题 100 之 3. 无重复字符的最长子串
# 题目 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: s = "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 示例 2: 输入: s = "bbbbb" 输出: 1 解释: 因为无重复字符的最长子串 ......
LeetCode 399. 除法求值
``` class Solution { public: vector calcEquation(vector>& equations, vector& values, vector>& queries) { unordered_set node;//记录所有节点 unordered_map> g; ......
SpringBoot使用Validator进行参数校验
>今天来聊聊在SprinBoot中如何集成参数校验Validator,以及参数校验的高阶技巧(自定义校验,分组校验)。 首先我们来看看什么是Validator参数校验器,为什么需要参数校验? # 为什么需要参数校验 在日常的接口开发中,为了防止非法参数对业务造成影响,经常需要对接口的参数做校验,例如 ......