leetcode validate binary nodes
LeetCode -- 764. 最大加号标志
利用动态规划的思想,把每个格子上下左右连续的1的个数算出来,再从头到尾遍历一遍即可获得答案。 c ++ class Solution { public: int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) { vector<ve ......
如何在Web应用程序中使用队列 – Node.js和Redis教程
当您构建大型 Web 应用程序时,速度是首要考虑的因素。用户不想再等待很长时间才能得到响应,他们也不应该这样做。但有些流程需要时间,而且无法加快或消除。 消息队列通过为通常的请求-响应过程提供额外的分支来帮助解决这个问题。这个额外的分支有助于确保用户能够立即得到响应,并且可以暂时完成耗时的流程。大家 ......
做题日记:1881. 插入后的最大值(leetcode)
题目: >给你一个非常大的整数 n 和一个整数数字 x ,大整数 n 用一个字符串表示。n 中每一位数字和数字 x 都处于闭区间 [1, 9] 中,且 n 可能表示一个 负数 。 >你打算通过在 n 的十进制表示的任意位置插入 x 来 最大化 n 的 数值 。但 不能 在负号的左边插入 ......
Node.js 常用知识
1、安装、卸载 modules 参考:https://www.cnblogs.com/phpjason/p/16354320.html npm install xxx 下载安装包到node_modelus npm install xxx@1.x.x 可以精确下载某个版本 npm install -- ......
vue前端使用node-rsa公钥加密解密
const NodeRSA = require('node-rsa'); // 使用公钥加密 export function encrypt (msg,commonKey) { const key = new NodeRSA(` BEGIN PUBLIC KEY ${commonKey} END P ......
c语言刷leetcode——图
[TOC] # 0.图和树的关系 1. 树是特殊的图,且是有向图 2. 树中没有环,而图中可能有 # 1.图的存储方式 - 图由点集和边集组成 - 图分为有向图和无向图,无向图可以理解为双向有向图 ## 1.1 邻接表 和 邻接矩阵 - 常见的图存储方式由邻接表(点集为核心)和邻接矩阵(边集为核心) ......
IDE validate什么意思?
IDE 是集成开发环境(Integrated Development Environment)的缩写,是一种用于软件开发的工具,提供了一系列的功能,包括代码编辑、编译、调试和测试等,能够提高开发效率。 "validate" 是验证的意思,常用于对数据或输入进行验证的过程。在IDE中,"validat ......
leetcode-682.棒球比赛
```go package main import ( "strconv" ) /* * @lc app=leetcode.cn id=682 lang=golang * * [682] 棒球比赛 */ // @lc code=start func sum(numbers []int) int { ......
leetcode 1466 重新规划路线 题解
### 解题思路 执行用时:140 ms, 在所有 Go 提交中击败了100.00%的用户 内存消耗:16.8 MB, 在所有 Go 提交中击败了82.00%的用户 将连接图转化成有向图,用二维slice存放。 此处将连接的起点设置为`from`也就是graph的外层下标,将连接的目标设为`targ ......
LeetCode 200. 岛屿数量
``` class Solution { public: bool st[310][310]; int dx[4]={0,0,-1,1},dy[4]={-1,1,0,0}; int m,n; int numIslands(vector>& g) { int res=0; n=g.size(),m=g ......
LeetCode 169. 多数元素
``` class Solution { public: int majorityElement(vector& nums) { int cnt=1; int res=nums[0]; for(int i=1;i<nums.size();i++) { if(nums[i]==res) cnt++; ......
LRU 力扣 146 https://leetcode.cn/problems/lru-cache/
一道经典题目,用双向链表去做能够满足O1的复杂度 核心代码如下 class LRUCache { MyLinkedList myLinkedList; int size; int capacity; HashMap<Integer, MyNode> map; public LRUCache(int ......
【构造,树】【Loj】Loj6669 Nauuo and Binary Tree
2023.7.3 [Problem Link](https://loj.ac/p/6669) 交互库有一棵 $n$ 个点的二叉树,你每次可以询问两个点之间的距离,猜出这棵二叉树。$n\le 3000$,询问次数上限 $30000$。 首先给你距离一定是先把每个点的深度问出来,确定一个大致的考虑顺序。 ......
解决k8s master节点上部署calico网络node节点一直NotReady状态的问题
## 解决k8s master节点上部署calico网络node节点一直NotReady状态的问题 > //20230707 最近在学习k8s,跟着书上的步骤搭建k8s集群,其中出了很多的问题,在此记录一下 ### 镜像pull不下来 > 安装k8s的过程中需要拉取很多的docker镜像,但是doc ......
[LeetCode] 2024. Maximize the Confusion of an Exam
A teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to confuse the students by maximizing ......
LeetCode
[剑指offer 05.替换空格](https://leetcode.cn/problems/ti-huan-kong-ge-lcof/) ```cpp class Solution { public: string replaceSpace(string s) { string out; for( ......
node js 版本更新
# 简介 RT # 命令 ``` sudo npm cache clean -f sudo npm install -g n sudo n stable ``` # 参考链接 https://askubuntu.com/questions/426750/how-can-i-update-my-nod ......
【vue-问题】vue : 无法加载文件 D:\Program Files\nodejs\node_global\vue.ps1,因为在此系统上禁止运行脚本
【vue-问题】vue : 无法加载文件 D:\Program Files\nodejs\node_global\vue.ps1,因为在此系统上禁止运行脚本。解决方法:①:管理员方式运行PowerShell,输入get-ExecutionPolicy。如果它回复Restricted,表示是禁止的②: ......
leetcode649队列操作Dota2
基本操作 入队: queue.push() queue.push_back()//两者效果相同 出队: queue.pop(); queue.pop_back();//都从尾部操作 考虑两个因素:1.每个参议员的决定都由之后的参议员决定 2.决定禁用之后都不能在投票 queue<int>radian ......
Codeforces Round 840 E - Node Pairs
# E - Node Pairs 题目链接:[E - Node Pairs](https://codeforces.com/contest/1763/problem/E "E - Node Pairs") ## 题意 题意晦涩难懂,但理解了之后就发现是让计算两个值: 1.最小的n使得一个具有n个点的 ......
VSCode如何通过Ctrl+P快速打开node_modules中的文件
咱们新建一个NodeJS项目,必然会安装许多依赖包,因此经常需要查阅某些依赖包的源码文件。但是,由于node_modules目录包含的文件太多,出于性能考虑,在VSCode中默认情况下是禁止搜索node_modules目录的。在这种情况下,我们将不得不依次展开node_modules的文件目录树,来... ......
How To Fix the ERR_OSSL_EVP_UNSUPPORTED Error in Node.js
Fix the ERR_OSSL_EVP_UNSUPPORTED Error There are two ways to fix the ERR_OSSL_EVP_UNSUPPORTED error: Upgrade Node.js by downloading and installing the ......
nvm安装node.js总结
nvm安装node.js总结 什么是nvm? nvm(Node.js version manager) 是一个命令行应用,可以协助您快速地 更新、安装、使用、卸载 本机的全局 node.js 版本。 为什么要用nvm? 有时候,我们可能同时在进行多个项目开发,而多个项目所使用的node版本又是不一样 ......
[LeetCode] 2178. Maximum Split of Positive Even Integers
You are given an integer finalSum. Split it into a sum of a maximum number of unique positive even integers. For example, given finalSum = 12, the fol ......
linux安装node
**1. 下载node** 去[nodejs官网](https://nodejs.org/en/download)下载最新版本  class Solution { public int majorityElement(int[] nums) { int count = ......
node restAPI 简单例子
// 第一版,node的httpp // const http = require('http'); // const server=http.createServer((req,res)=>{ // if(req.url '/'){ // res.write('hello world') // r ......
leetcode-1652-easy
Defuse the Bomb ``` You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n ......
leetcode-1629-easy
Slowest Key ``` You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n and ......