leetcode validate binary nodes

Leetcode之0709, 修改字符串

1 class Solution { 2 public: 3 string toLowerCase(string s) { 4 for(char &ch: s){ 5 if(ch>='A' && ch<='Z'){ 6 ch=tolower(ch); 7 } 8 } 9 return s; 10 } ......
字符串 字符 Leetcode 0709

【每日一题】Problem 538B. Quasi Binary

[原题](https://codeforces.com/problemset/problem/538/B) #### 解决思路 最简单的思路就是贪心了,每次生成不超过目标值的 $quasibinary$,即可使最终数量最少 ```C++ #include int quasibinary(int ma ......
Problem Binary Quasi 538

[LeetCode] 2486. Append Characters to String to Make Subsequence

You are given two strings s and t consisting of only lowercase English letters. Return the minimum number of characters that need to be appended to th ......

[刷题记录Day4]Leetcode链表专题

# No.1 ## 题目 [两两交换链表中的节点](https://leetcode.cn/problems/swap-nodes-in-pairs/) ## 思路 - 模拟类型题目 - 两个节点前后交换,同时记住原来的下一个节点 - 虚拟头节点 ## 代码 ```Java public ListN ......
Leetcode 专题 Day4 Day

LeetCode 1201. Ugly Number III 数学+二分答案

An ugly number is a positive integer that is divisible by $a$, $b$, or $c$. Given four integers $n$, $a$, $b$, and $c$, return the $n$th ugly number. ......
LeetCode 答案 数学 Number 1201

LeetCode 875. Koko Eating Bananas 二分答案

Koko loves to eat bananas. There are $n$ piles of bananas, the $i$th pile has $piles[i]$ bananas. The guards have gone and will come back in `h` hours ......
LeetCode 答案 Bananas Eating Koko

node.js压缩版安装

## 一、下载压缩包 前往 [nodejs](https://nodejs.org) 官网,一般选择长期稳定版(LTS)安装 ## 二、解压缩包 然后在安装目录下新建两个文件夹 *npm_cache* 和 *npm_global* 在当前目录里打开cmd,配置NPM全局模块路径和cache默认安装位 ......
node js

Node-框架NestJS入门使用

前言 介绍 Nest是一个用于构建高效,可扩展的Node.js服务器端应用程序的框架。它使用渐进式JavaScript,使用TypeScript构建(保留与纯JavaScript的兼容性),并结合了OOP(面向对象编程),FP(功能编程)和FRP(功能反应编程)的元素。 注意 请确保你的操作系统上安 ......
框架 NestJS Node

LeetCode 1011. Capacity To Ship Packages Within D Days 二分答案

A conveyor belt has packages that must be shipped from one port to another within `days` days. The ith package on the conveyor belt has a weight of $w ......
LeetCode Capacity Packages 答案 Within

用docker搭建自己的node服务器集群

1.配置java环境,并提交镜像: ```sh # 1.解析jdk的包到 /usr/local/java 下: # 2.并配置java环境 [root@07e065a05df9 /]# vim /etc/profile.d/my_env.sh # JAVA_HOME export JAVA_HOME ......
集群 服务器 docker node

Whistle(基于Node实现的跨平台转包调试工具)的使用

可抓包,可显示vconsolet调试 一、安装 npm i -g whistle 二、启动 手机和电脑处于同一网络 w2 start --init 浏览器打开地址:http://127.0.0.1:8899/ 三、配置 Rules:https://testh.app.coc.10086.cn whi ......
Whistle 工具 Node

leetcode练习

## 分类 题单:[code](#code) 难度:[简单](#Simple) [中等](#middle) [困难](#hard) 类型:[数组](#数组) [链表](#链表) [字符串](#字符串) [二叉树](#二叉树) [排序](#排序) 解法:[递归和迭代](#递归和迭代) [滑动窗口 ]( ......
leetcode

leetcode 546. 移除盒子

1. 题目 读题 链接:https://www.nowcoder.com/questionTerminal/a5390d76441647fbb182f34bee6a1ca7来源:牛客网一维消消乐 小v在vivo手机的应用商店中下载了一款名为“一维消消乐”的游戏,介绍如下: 1、给出一些不同颜色的豆子 ......
盒子 leetcode 546

[LeetCode] 2461. Maximum Sum of Distinct Subarrays With Length K

You are given an integer array nums and an integer k. Find the maximum subarray sum of all the subarrays of nums that meet the following conditions: T ......
Subarrays LeetCode Distinct Maximum Length

[LeetCode] 2222. Number of Ways to Select Buildings

You are given a 0-indexed binary string s which represents the types of buildings along a street where: s[i] = '0' denotes that the ith building is an ......
Buildings LeetCode Number Select 2222

Leetcode日记

| 日期 | 题号 | 题目 | 解法 | 难度 | | | | | | | | 2023-07-11 | 2741 | [给定一个互不相同的正整数数组,找出**特别排列**(相邻元素互模任一为0)的总数目。取余](https://leetcode.cn/problems/special-permu ......
Leetcode 日记

[LeetCode] 874. Walking Robot Simulation

A robot on an infinite XY-plane starts at point (0, 0) facing north. The robot can receive a sequence of these three possible types of commands: -2: T ......
Simulation LeetCode Walking Robot 874

[LeetCode] 2597. The Number of Beautiful Subsets

You are given an array nums of positive integers and a positive integer k. A subset of nums is beautiful if it does not contain two integers with an a ......
Beautiful LeetCode Subsets Number 2597

LeetCode 852. Peak Index in a Mountain Array 二分

An array arr a mountain if the following properties hold: * `arr.length` >= 3 * There exists some i with `0 arr[i + 1] > ... > arr[arr.length - 1] ``` ......
LeetCode Mountain Index Array Peak

关于调用支付宝密钥出现的报错问题 Not a valid PEM post boundary

在项目的支付模块中我配置了settings.py文件 import os # 应用私钥 APP_PRIVATE_KEY_STRING = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'pem', 'app_private ......
密钥 boundary 问题 valid post

使用node开发脚手架报错:Error [ERR_REQUIRE_ESM]: Must use import to load ES Module

在使用 node 开发脚手架的时候,每次执行命令都会报错 :Error [ERR_REQUIRE_ESM]: Must use import to load ES Module 经过排查发现,原因为 chalk 包为 5 版本以上导致的。 const chalk = require('chalk') ......

node_export自定义启动监控指标

/usr/local/bin/node_exporter --collector.ntp --collector.supervisord --collector.supervisord.url=http://localhost:9001/RPC2 --collector.textfile.direc ......
node_export 指标 export node

leetcode104二叉树搜索

深度优先搜索,递归 maxDepth(TreeNode* root){ if(!root)return 0; return max(maxDepth(root->left),maxDepth(root->right))+1; } 广度优先搜索,队列 queue<TreeNode*>q; q.push ......
leetcode 104

LeetCode 301. 删除无效的括号

``` class Solution { public: vector ans; vector removeInvalidParentheses(string s) { //lr分别记录要删除的左右括号数量 int l=0,r=0; for(auto c:s) if(c=='(') l++; els ......
括号 LeetCode 301

kubeasz K8S测试环境删除多余 node 节点

## kubeasz K8S测试环境删除多余 node 节点 > 背景:公司之前存在3套 test 环境,有 1 套环境部署的 生产环境老系统,目前生产环境已经完成了新老系统切换,不在需要老系统 test 环境,需要进行回收 ### 1 | 查看节点列表 使用kubectl命令来查看当前集群中的节点 ......
节点 kubeasz 环境 node K8S

sqlite3.OperationalError: no such function: JSON_VALID

``` Initializing database.. Traceback (most recent call last): File "d:\program files\python38\lib\site-packages\django\db\backends\utils.py", line 82 ......

[LeetCode] 1851. Minimum Interval to Include Each Query

You are given a 2D integer array intervals, where intervals[i] = [lefti, righti] describes the ith interval starting at lefti and ending at righti (in ......
LeetCode Interval Include Minimum Query

针对el-menu-item组件的警告Invalid event arguments: event validation failed for event "cli

##### 现象: ![image](https://img2023.cnblogs.com/blog/2045410/202307/2045410-20230717215643378-1042692896.png) ##### 解决办法: ![image](https://img2023.cnbl ......

node

## 安装 ### Linux ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash # 查看nvm版本 nvm -v # 配置淘宝镜像 提升下载速度 export NVM_NO ......
node

leetcode2130反转链表

1尾插法:记录前面的节点,使后面的节点指向前面的节点;记后面的节点为now。因为要不停移动now,使其移动所以要临时记录原来之后的节点。 ListNode* now=slow->next; ListNode* pre=nullptr; while(now){ ListNode* node=now-> ......
leetcode 2130