leetcode validate binary nodes

[LeetCode] 2785. Sort Vowels in a String

Given a 0-indexed string s, permute s to get a new string t such that: All consonants remain in their original places. More formally, if there is an i ......
LeetCode Vowels String 2785 Sort

finalshell报错java.net.UnknownHostException: node2

前几天是node3连不上,今天早上写作业发现node2又连不上了 ]$ systemctl status network.service ● network.service - LSB: Bring up/down networking Loaded: loaded (/etc/rc.d/init. ......

[LeetCode] 1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance

There are n cities numbered from 0 to n-1. Given the array edges where edges[i] = [fromi, toi, weighti] represents a bidirectional and weighted edge b ......
the Neighbors Threshold LeetCode Distance

mac node 卸载 homebrew

mac node 卸载 如果是通过source或者binaries 方式安装 Nodejs , 需要手动删除 Node executables和其他resources, 另外就是使用 Homebrew的方法 、nvm 方法 。 1. 手动方法: 需要按如下步骤卸载node + npm : 从/usr ......
homebrew node mac

node-gyp无python环境问题

如上图所示,这里报错 can't find Python executable "python",这个报错其实就是没有python环境,这里安装python 2.7版本即可,有人说3.0以上的python无效,我没试过。 https://www.python.org/downloads/releas ......
node-gyp 环境 python 问题 node

node+express服务给前端提供markdown数据,前端渲染md文件在页面上

本文介绍后端怎么把markdown文件发给前端,前端又怎么渲染在页面中。 先看效果图 md文件代码: 前端网页渲染: 先介绍node+express怎么提供接口: const express = require("express"); const router = express.Router(); ......
前端 markdown express 页面 文件

[Leetcode] 0836. 矩形重叠

836. 矩形重叠 English Version 题目描述 矩形以列表 [x1, y1, x2, y2] 的形式表示,其中 (x1, y1) 为左下角的坐标,(x2, y2) 是右上角的坐标。矩形的上下边平行于 x 轴,左右边平行于 y 轴。 如果相交的面积为 正 ,则称两矩形重叠。需要明确的是, ......
矩形 Leetcode 0836

LeetCode 第 115 场双周赛

2899. 上一个遍历的整数 感觉读题比较困难 class Solution { public: vector<int> lastVisitedIntegers(vector<string>& words) { vector<int> res , a ; for( int i = 0 , cnt = ......
LeetCode 115

LeetCode -- 第 371 场周赛(哈希表,tire字典树)

class Solution { public: vector<string> findHighAccessEmployees(vector<vector<string>>& access_times) { int n = access_times.size(); vector<string> re ......
字典 LeetCode tire 371

leetcode hot100-02 字母异位词分组

题目:字母异位词分组 难度:中等 地址:https://leetcode.cn/classic/problems/group-anagrams/description/ 描述:给你一个字符串数组,请你将 字母异位词 组合在一起。可以按任意顺序返回结果列表。字母异位词 是由重新排列源单词的所有字母得到 ......
字母 leetcode hot 100

leetcode hot 100-01 两数之和

题目:两数之和 难度:简单 题目地址:https://leetcode.cn/classic/problems/two-sum/description/ 过程一,因为难度是简单,就没有仔细审题,以为返回两个数就好,使用双指针,逻辑如下: 对数组排序 双指针分别指向头和尾 两数之和大于target,尾 ......
之和 leetcode hot 100

关于node安装的一些琐事

macbook M1 2020 node版本管理使用nvm nvm ls 查看当前安装的node版本 nvm install 14.21.3 下载14.21.3版本 nvm use 14.21.3 使用node版本 nvm alias default 14.21.3 需要将Node.js 14.21 ......
琐事 node

[LeetCode] 1360. Number of Days Between Two Dates 日期之间隔几天

Write a program to count the number of days between two dates. The two dates are given as strings, their format is YYYY-MM-DD as shown in the examples ......
LeetCode 之间 日期 Between Number

导出相关binary制作k8s本地包

这次把我之前安装的k8s的包导出来保存。 cd /var/cache/apt/ ls kube* cd ~ && mkdir k8sdbinstall sudo cp *_1.23.17* ~/k8sdbinstall ......
binary k8s 8s k8

VS Code搭建Node.js环境

VS Code搭建Node.js环境 VS Code集成了方便的Node.js插件,使您可以轻松安装和配置Node.js环境。您可以采用以下步骤来搭建Node.js环境。 1. 安装VS Code 在VS Code官网上下载并安装VS Code 2. 安装Node.js插件 在VS Code插件市场 ......
环境 Code Node VS js

[数据校验/数据质量] 数据校验框架:hibernate-validation

0 前言 其一,项目中普遍遇到了此问题,故近两天深入地研究了一下。 其二,能够自信地说,仔细看完本篇,就无需再看其他的Java数据校验框架的文章了。 1 数据校验框架概述 1.0 数据校验框架的产生背景 以Web项目为例,用户需要填写表单信息保存提交。 页面输入信息需要进行数据格式校验,并且返回对应 ......

请问以下JS代码在Node环境下的输出顺序是?

请问以下JS代码在Node环境下的输出顺序是? Promise.resolve() .then(() => { console.log('p1'); }) .then(() => { console.log('p2'); }) process.nextTick(() => { console.log ......
顺序 代码 环境 Node

node 栈溢出 解决办法

启动项目时报错 解决办法:在package.json里面找到启动项目命令,加上NODE_OPTIONS=\"--max-old-space-size=4096\"即可 "scripts": { "serve": " NODE_OPTIONS=\"--max-old-space-size=4096\" ......
办法 node

mac 升级、切换node版本

mac可以使用node.js多版本管理器n来帮助升级以及切换node版本 具体命令: 2、sudo npm install -g n //使用npm安装n模块 3、npm view node versions // 查看node所有版本 4、sudo n latest // 升级到最新版本 sudo ......
版本 node mac

brew安装nvm、node及配置

用brew安装nvm brew install nvm 创建nvm的工作目录 mkdir ~/.nvm 配置环境变量 vim ~/.bash_profile ## 添加配置 export NVM_DIR="$HOME/.nvm" [ -s "/opt/homebrew/opt/nvm/nvm.sh" ......
brew node nvm

nvm的安装及Node.js环境配置

一、nvm是什么? nvm是一个node的版本管理工具,可以简单操作node版本的切换、安装、查看、等等 二、nvm的安装 1.windows包下载地址: 下载nvm安装包,下载地址:https://github.com/coreybutler/nvm-windows/releases 2. 双击安 ......
环境 Node nvm js

Leetcode133.克隆图

需要注意图中存在环路。 JAVA: public final Node cloneGraph(Node node) { return deepCopy(node, new HashMap<Integer, Node>()); } private Node deepCopy(Node node, Ha ......
Leetcode 133

Node.js framework express.js middleware All In One

Node.js framework express.js middleware All In One express.js middlewares order ......
middleware framework express Node js

LeetCode450.删除二叉搜索树中的节点

题目描述 给定一个二叉搜索树的根节点 root 和一个值 key,删除二叉搜索树中的 key 对应的节点,并保证二叉搜索树的性质不变。返回二叉搜索树(有可能被更新)的根节点的引用。 一般来说,删除节点可分为两个步骤: 首先找到需要删除的节点; 如果找到了,删除它。 说明: 要求算法时间复杂度为 $O ......
节点 LeetCode 450

树状数组(Binary Index Tree)

一、问题引入 Logu P3374 模版题--树状数组。 初始化一个数组,接下来进行若干次以下操作: 单点修改:将某个元素的值进行修改 区间访问:返回该区间的总和 问题分析 如果通过简单索引操作,“1”的时间复杂度为 O(1),“2”的时间复杂度为O(n),其中如果使用一个dp表的方式来存储前n项之 ......
数组 Binary Index Tree

Springboot使用@validation

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> /** * @Validate默认是会全部校验的 * 在这里 ......
Springboot validation

react项目运行时,node运行内存不足

修改reactd项目的less文件后热更新报错 FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory 解决办法 全局安装插件"increase-memory-limit",用来增加运行内存 ......
内存 项目 react node

Memo Pack and LeetCode 3

Memo Pack Source code: git.suckless.org/sbase I don't know if it's the standard implementation for Linux bash command, but it's a good material. An ex ......
LeetCode Memo Pack and

Leetcode108. 将有序数组转换为二叉搜索树

因为数组是有序的,可以递归的选取根节点构建子树。 JAVA: public final TreeNode sortedArrayToBST(int[] nums) { if (null == nums) return null; return this.build(nums, 0, nums.len ......
数组 Leetcode 108

LeetCode #1131 Maximum of Absolute Value Expression 绝对值表达式的最大值

安装Flutter环境首先配置flutter3开发环境,照着官方教程傻瓜式安装即可。>>安装和环境配置 | Flutter 中文文档 | Flutter 中文开发者网站注意在国内网络环境下需要进行一些额外的环境配置:>>在中国网络环境下使用 Flutter | Flutter 中文文档 | Flut ......