leetcode 45 ii

LeetCode----回溯

# 1 算法模板 ``` for 选择 in 选择列表: # 做选择 将该选择从选择列表移除 路径.add(选择) backtrack(路径, 选择列表) # 撤销选择 路径.remove(选择) 将该选择再加入选择列表 ``` # 2 代码示例 [46. 全排列](https://leetcode ......
LeetCode

前缀和的应用 II

[TOC] # 应用 ## 应用1:396. 旋转函数 ### 题目 [396. 旋转函数](https://leetcode.cn/problems/rotate-function/) > 给定一个长度为 n 的整数数组 nums 。 > 假设 arrk 是数组 nums 顺时针旋转 k 个位置后 ......
前缀 II

LeetCode----二维网格DFS

# 1 算法模板 ``` void dfs(int[][] grid, int r, int c) { // 判断 base case // 如果坐标 (r, c) 超出了网格范围,直接返回 if (!inArea(grid, r, c)) { return; } // 访问上、下、左、右四个相邻结 ......
网格 LeetCode DFS

第二天|977. 有序数组的平方 209.长度最小的子数组 59.螺旋矩阵II

这题花了很久去debug,之前都是直接乘完直接排序的。今天用了一下双指针,边界的问题最后还是喵了一眼答案。 这题上次没刷出来,直接看的答案用的队列的思路,需要复习: 这道题和我上次面试蚂蚁的题目非常相似,都是这种旋转的题目。当时非常难想出来现在有一个具体思路了: ......
数组 矩阵 螺旋 长度 977

[LeetCode] 1351. Count Negative Numbers in a Sorted Matrix

Given a m x n matrix grid which is sorted in non-increasing order both row-wise and column-wise, return the number of negative numbers in grid. Exampl ......
LeetCode Negative Numbers Matrix Sorted

递归-二叉搜索树-leetcode98验证二叉搜索树

```java //leetcode submit region begin(Prohibit modification and deletion) /** * Definition for a binary tree node. * public class TreeNode { * int va ......
leetcode 98

LeetCode35.搜索插入位置

//个人学习笔记用 - 题目: 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。 请必须使用时间复杂度为 O(log n) 的算法。 参考题解--代码随想录 - 暴力解法: ~~~c++ class Solution { pub ......
LeetCode 位置 35

7. 基础算法(II)

## 7.1 位运算 **模板**:[AcWing 90. 64位整数乘法](https://www.acwing.com/problem/content/92/) **题目**:求 $a\times b\bmod p$。$1\le a,b,p\le 10^{18}$。 **思路**: **方法一* ......
算法 基础

LeetCode 90. 子集 II

``` class Solution { public: unordered_map cnt; vector> res; vector path; vector> subsetsWithDup(vector& nums) { for(auto i:nums) cnt[i]++; dfs(-10);/ ......
子集 LeetCode 90 II

【leetcode】104. Maximum Depth of Binary Tree

给定一个二叉树,找出其最大深度。 二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 **说明:** 叶子节点是指没有子节点的节点。 **示例:** 给定二叉树 `[3,9,20,null,null,15,7]`, ``` 3 / \ 9 20 / \ 15 7 ``` 返回它的最大深度 3 ......
leetcode Maximum Binary Depth Tree

LeetCode 40. 组合总和 II

``` class Solution { public: vector> res; vector> combinationSum2(vector& candidates, int target) { sort(candidates.begin(),candidates.end()); dfs(can ......
总和 LeetCode 40 II

LeetCode 39. 组合总和

``` class Solution { public: vector> res; vector> combinationSum(vector& candidates, int target) { dfs(candidates,0,target); return res; } vector path ......
总和 LeetCode 39

【leetcode】21. Merge Two Sorted Lists

将两个升序链表合并为一个新的 **升序** 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:** ![](https://assets.leetcode.com/uploads/2020/10/03/merge_ex1.jpg) **输入:**l1 = \[1,2,4\] ......
leetcode Sorted Merge Lists Two

Leetcode 2611. 老鼠和奶酪

### 题目: 有两只老鼠和 `n` 块不同类型的奶酪,每块奶酪都只能被其中一只老鼠吃掉。 下标为 `i` 处的奶酪被吃掉的得分为: - 如果第一只老鼠吃掉,则得分为 `reward1[i]` 。 - 如果第二只老鼠吃掉,则得分为 `reward2[i]` 。 给你一个正整数数组 `reward1` ......
奶酪 Leetcode 老鼠 2611

每个 ASP.NET 开发人员都应该知道的 IIS 管道中的 HTTP 请求生命周期事件

![](https://img2023.cnblogs.com/blog/699074/202306/699074-20230607173742257-1367510520.png) 原文:https://www.dotnetcurry.com/aspnet/747/http-request-lif ......
管道 周期 事件 生命 人员

B. Mine Sweeper II

题解: 先给一个置反:把原来的空白格变成雷,把原来的雷变成空白格。这道题的重点就是要意识到,一个雷能够影响周围多少个空白格,那么置反之后,就会有多少个原来的空白格变成的雷影响它。 那么B要和A sum相等,只要和A相同,或者和A的置反图相同即可。 ......
Sweeper Mine II

LeetCode----字典树

# 1 原理 [字典树原理参考](https://blog.csdn.net/m0_46202073/article/details/107253959) # 2 构建字典树 ```python class Trie: def __init__(self): # 字典树结构 # children 数 ......
字典 LeetCode

Leetcode刷题指南

## 1. 数据结构 ### 1.1 数组 - **循环数组问题**:把数组扩大为两倍即可,但不是真的扩大两倍,而是通过索引取模的方式 ### 1.2 链表 链表可以通过引入虚拟头节点 `ListNode *dummy = new ListNode{-1, nullptr}` 来极大简化 0. ** ......
Leetcode 指南

leetcode 17. 电话号码的字母组合

## 递归 自己写了个递归的算法 ```java class Solution { public List letterCombinations(String digits) { List resList = recursion(digits); return resList; } public L ......
电话号码 字母 leetcode 号码 电话

Leetcode 2352. 相等行列对

### 题目: 给你一个下标从 `0` 开始、大小为 `n x n` 的整数矩阵 `grid` ,返回满足 `R~i~` 行和 `C~j~` 列相等的行列对 `($$R_i$$, C~j~)` 的数目。 如果行和列以相同的顺序包含相同的元素(即相等的数组),则认为二者是相等的。 ### 难度:简单 ......
行列 Leetcode 2352

自己生成泛域名证书,window iis 泛域名证书

在 Windows 系统上使用 OpenSSL 和 Certbot 生成并打包浏览器认可的 SSL 证书,你可以按照以下步骤操作: 安装 OpenSSL:首先,你需要在你的 Windows 系统上安装 OpenSSL。你可以从 OpenSSL 官方网站 下载适合你系统的版本。 安装 Certbot: ......
证书 域名 window iis

widnows2012 r2上安装iis 报错,提示找不到原文件位置的解决办法。

服务器win2012安装.Net Framework 3.5 失败的解决方法 安装一个或多个角色、角色服务或功能失败。 找不到源文件。请在尝试在新的“添加角色和功能”向导会话中安装角色、角色服务或功能,然后在向导的“确认”页中单击“指定备用源路径”以指定安装所需的源文件的有效位置。目标服务器的计算机 ......
位置 widnows 办法 文件 2012

45基于java的民宿管理平台设计与实现

基于java的民宿管理平台设计与实现,java民宿,民宿预约管理平台系统,酒店预订系统,酒店管理系统,酒店房间预订,旅游业有关网上民宿预订酒店房间管理系统,民宿信息管理平台。 ......
民宿 平台 java

leetcode 15. 三数之和

## 暴力法 暴力解法总是最直接能想到的解法。 ```java NA ``` ## 双指针法 贴一个评论区看到的解法 ```java class Solution { //定义三个指针,保证遍历数组中的每一个结果 //画图,解答 public List> threeSum(int[] nums) { ......
之和 leetcode 15

Leetcode Hot 100 & 49. Group Anagrams

写在前面: 不知不觉已经研二下了,既然选择以后走AI这条路,不可避免地也得刷一刷leetcode题目,因为招聘的时候笔试总是要用到的。首先刷一刷leetcode的hot 100题,好记性赶不上烂笔头,记录下来在写这些算法题中的收获给自己看。 参考资料: 考点:哈希 & [题干] 这题没做出来,第一次 ......
Leetcode Anagrams Group Hot 100

查看IIS站点对应的进程ID

1. 管理员身份运行cmd;2. 跳转到C:\Windows\System32\inetsrv目录;3. 然后运行appcmd list wp即可查看IIS应用程序池的进程ID; cd C:\Windows\System32\inetsrv appcmd list wp ......
进程 站点 IIS

[LeetCode] 2352. Equal Row and Column Pairs

Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair is co ......
LeetCode Column Equal Pairs 2352

算法学习day45动态规划part07-322、279

package LeetCode.DPpart07; /** * 322. 零钱兑换 * 给你一个整数数组 coins ,表示不同面额的硬币;以及一个整数 amount ,表示总金额。 * 计算并返回可以凑成总金额所需的 最少的硬币个数 。如果没有任何一种硬币组合能组成总金额,返回-1 。 * 你可 ......
算法 动态 part day 322

[LeetCode] 1347. Minimum Number of Steps to Make Two Strings Anagram 制造字母异位词的最小步骤数

You are given two strings of the same length `s` and `t`. In one step you can choose **any character** of `t` and replace it with **another character* ......
字母 LeetCode 步骤 Anagram Minimum

leetcode-图论总结

此文总结一下常见图论算法,代码可以为后续遇见类似题目提供参考: 1. 图的表示: 邻接矩阵:可通过创建数组得到 邻接表:我个人喜欢通过LinkedList<int[]>[] graph = new LinkedList[n];得到。 Edge List:同样可以通过LinkedList<int[]> ......
leetcode