leetcode 45 ii

leetcode-滑动窗口总结

滑动窗口是我在刷题时感觉比较困难的部分,简单做一个总结,防止之后又忘了: 一般模板如下: // 注意:java 代码由 chatGPT🤖 根据我的 cpp 代码翻译,旨在帮助不同背景的读者理解算法逻辑。 // 本代码还未经过力扣测试,仅供参考,如有疑惑,可以参照我写的 cpp 代码对比查看。 /* ......
leetcode

Leetcode 2460. 对数组执行操作

### 题目: 给你一个下标从 **0** 开始的数组 `nums` ,数组大小为 `n` ,且由 **非负** 整数组成。 你需要对数组执行 `n - 1` 步操作,其中第 `i` 步操作(从 **0** 开始计数)要求对 `nums` 中第 `i` 个元素执行下述指令: - 如果 `nums[i ......
数组 Leetcode 2460

[LeetCode] 2460. Apply Operations to an Array

You are given a 0-indexed array nums of size n consisting of non-negative integers. You need to apply n - 1 operations to this array where, in the ith ......
Operations LeetCode Apply Array 2460

代码随想录算法训练营第二十七天|39. 组合总和,40. 组合总和 II,131. 分割回文串

【参考链接】 39. 组合总和 【注意】 1.candidates 中的数字可以无限制重复被选取。 2.在for循环中进行剪枝。剪枝前需要对数组进行排序。 【代码】 1 class Solution(object): 2 def __init__(self): 3 self.path = [] 4 ......
总和 随想录 回文 训练营 随想

LeetCode 669. 修剪二叉搜索树

#### 思路 - 遍历所有节点,如果当前节点不在所给区间里,删除该点;否则 - 如果该点要被删除,将其左右子树其中之一提上来即可 - 根节点位于左右子树取值区间的中间,如果该点要被删除,那么一定存在不满足要求的子树,不可能两棵子树同时保留 #### 代码 ```c class Solution { ......
LeetCode 669

602. 好友申请 II :谁有最多的好友

【题目】 在 Facebook 或者 Twitter 这样的社交应用中,人们经常会发好友申请也会收到其他人的好友申请。RequestAccepted 表:+ + +| Column Name | Type |+ + +| requester_id | int || accepter_id | int ......
好友 602 II

[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 Double Check

LeetCode 周赛 348(2023/06/05)数位 DP 模板学会了吗

> **本文已收录到 [AndroidFamily](https://github.com/pengxurui/AndroidFamily),技术和职场问题,请关注公众号 [彭旭锐] 加入知识星球提问!** - 往期回顾:[LeetCode 单周赛第 347 场 · 二维空间上的 LIS 最长递增子 ......
数位 LeetCode 模板 2023 348

Leetcode 2517. 礼盒的最大甜蜜度

### 题目: 给你一个正整数数组 `price` ,其中 `price[i]` 表示第 `i` 类糖果的价格,另给你一个正整数 `k` 。 商店组合 `k` 类 不同 糖果打包成礼盒出售。礼盒的 **甜蜜度** 是礼盒中任意两种糖果 **价格** 绝对差的最小值。 返回礼盒的 **最大** 甜蜜度 ......
礼盒 Leetcode 2517

Leetcode 1156. 单字符重复子串的最大长度

### 题目: 如果字符串中的所有字符都相同,那么这个字符串是单字符重复的字符串。 给你一个字符串 `text`,你只能交换其中两个字符一次或者什么都不做,然后得到一些单字符重复的子串。返回其中最长的子串的长度。 ### 难度:中等 #### 示例1: ``` 输入:text = "ababa" 输 ......
单字 长度 Leetcode 1156

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 450

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 538

[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 1345 Jump Game IV

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) ......
LeetCode 501

winows 下iis+nginx +php 部署

我们服务器使用的server 2008,由于iis里还有asp.net 网站,php就想用iis做代理转发到nginx 来处理请求。 第一步:我为了省事,直接安装的phpstudy 下载地址:https://www.xp.cn/ 第二步: 安装好后,设置运行fast-cgi,可以使用以下命令做bat ......
winows nginx iis php

[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 Detonate Maximum Bombs 2101

LeetCode.螺旋矩阵问题

## LeetCode54 螺旋矩阵 ![image-20220708211259147](https://img2023.cnblogs.com/blog/2896522/202306/2896522-20230602225454384-849616346.png) ### 思路 就是说,**给我 ......
矩阵 螺旋 LeetCode 问题

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){//存储列向量 ......
容器 leetcode 类型 2352

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 vector 2352

Leetcode 2559. 统计范围内的元音字符串数

### 题目: 给你一个下标从 `0` 开始的字符串数组 `words` 以及一个二维整数数组 `queries` 。 每个查询 `queries[i] = [l, r]` 会要求我们统计在 `words` 中下标在 `l` 到 `r` 范围内(包含 这两个值)并且以元音开头和结尾的字符串的数目。 ......
元音 字符串 字符 Leetcode 范围

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 ......
损益 leetcode 资本 股票 1393

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 ......
祖先 LeetCode 236

LeetCode235. 二叉搜索树的最近公共祖先

```c class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { if(p->valval&&q->valval) return lowestCommonA ......
祖先 LeetCode 235

剑指 Offer II 048. 序列化与反序列化二叉树

题目链接:[剑指 Offer II 048. 序列化与反序列化二叉树](https://leetcode.cn/problems/h54YBf/) ## 方法:先序遍历(dfs) ### 解题思路 在先序遍历过程中,节点值之间通过空格隔开,好利于后续反序列化过程中获取值。 ### 代码 ```cpp ......
序列 Offer 048 II

[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 ......
LeetCode Strings Ranges Count Vowel

IIS 应用程序池 PowerShell 脚本更改高级属性的方法

## IIS WebAdmin Module Import-Module WebAdministration $AppPool = "mqttService(8011)" $Site = "mqttService(8011)" $AppPoolInstance = Get-Item IIS:\App ......
应用程序 脚本 PowerShell 属性 程序

IIS 发布vue 方向代理配置

web(iis 配置).config ......
方向 IIS vue

LeetCode/叶值的最小代价生成树

给你一个正整数数组 arr,考虑所有满足以下条件的二叉树: 每个节点都有 0 个或是 2 个子节点。 数组 arr 中的值与树的中序遍历中每个叶节点的值一一对应。 每个非叶节点的值等于其左子树和右子树中叶节点的最大值的乘积。 在所有这样的二叉树中,返回每个非叶节点的值的最小可能总和。 ###1. 贪 ......
LeetCode 代价

Razor Pages本地IIS服务器部署流程及部分问题解决方法

记录一下自己在本地IIS服务器部署的基本流程: 添加IIS服务器 控制面板 >> 程序和功能 启用或关闭windows功能 >> 勾选相关功能 网站部署 将项目发布(publish)至本地文件夹: 在包含.sln文件的目录下打开终端,输入 dotnet publish -c debug --no-s ......
流程 部分 服务器 方法 问题

IIS短文件名泄露漏洞

1、windows的短文件名机制 (1)介绍 为了兼容16位MS-DOS程序,Windows为文件名较长的文件(和文件夹)生成了对应的windows 8.3 短文件名。 dir /x 列出当前目录的子目录和文件,以及相应的8.3兼容名称(如果有的话) win10,默认是没有开启8.3兼容特性,无法显 ......
文件名 漏洞 文件 IIS