operations leetcode minimum halve

[LeetCode] 1870. Minimum Speed to Arrive on Time

You are given a floating-point number hour, representing the amount of time you have to reach the office. To commute to the office, you must take n tr ......
LeetCode Minimum Arrive Speed 1870

【Azure 环境】AAD 注册应用获取AAD Group权限接口遇 403 : Attempted to perform an unauthorized operation 错误

问题描述 通过Azure AD的注册应用获取到Token后,访问AAD Group并查看日志信息时候,遇见了 {"error":{"code":"UnauthorizedAccessException","message":"Attempted to perform an unauthorized ......
unauthorized AAD Attempted operation 接口

[ABC308G] Minimum Xor Pair Query 题解

[Minimum Xor Pair Query](https://www.luogu.com.cn/problem/AT_abc308_g) ### 题目大意 维护一个序列,支持动态插入,删除,查询最小异或对。 ### 思路分析 看到查询最小异或对首先想到 01Trie,但 01Trie 不支持删除 ......
题解 Minimum Query 308G Pair

代码随想录算法训练营第一天| LeetCode 704. 二分查找、LeetCode 27. 移除元素

704. 二分查找 题目链接:https://leetcode.cn/problems/binary-search/ 视频链接:https://www.bilibili.com/video/BV1fA4y1o715 文章讲解:https://programmercarl.com/0704.%E4%B ......
LeetCode 随想录 训练营 随想 算法

1775.equal sum arrays with minimum number of operations

Description 1775.equal-sum-arrays-with-minmum-number-of-operations Solution hash table + greedy algorithm The general idea of this problem is hash + g ......
operations minimum arrays number equal

871.minimum number of refueling stops

Description 871.minimum-number-of-refueling-stops Solution Dynamic programming In this problem, the number is finite, and there is a recurrence relati ......
refueling minimum number stops 871

pandoc: pdflatex: createProcess: posix_spawnp: illegal operation

RuntimeError: Pandoc died with exitcode "1" during conversion: pandoc: pdflatex: createProcess: posix_spawnp: illegal operation (Inappropriate ioctl f... ......

LeetCode 560. 和为 K 的子数组

``` class Solution { public: int subarraySum(vector& nums, int k) { int n=nums.size(),res=0; vector s(n+1,0); unordered_map hash;//记录端点i之前所有前缀和的出现情况 f ......
数组 LeetCode 560

Leetcode437. 路径总和 III

``` /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), ......
总和 路径 Leetcode 437 III

[LeetCode] 2013. Detect Squares

You are given a stream of points on the X-Y plane. Design an algorithm that: Adds new points from the stream into a data structure. Duplicate points a ......
LeetCode Squares Detect 2013

go刷题Leetcode,生成文件夹与go文件模板

## go生成文件夹与模板 ### 起因 以前是用C/C++刷Leetcode时,将多个C/CPP文件放在同一个目录下,没有出任何问题,但是换成Go语言刷题。 在一个目录下创建多个go文件,每个文件都是以下 ```go package main func main(){ } ``` 在vscode下 ......
文件 文件夹 Leetcode 模板

leetcode1448好节点深刻理解DFS+BFS

DFS 没有返回值 max在递归时要慎重用引用,因为在回溯时可能不能改变max; 因为节点的值可能有负数,所以最大值从根节点开始,根节点一定是好节点。 int goodNum=0; void dfs(TreNode* root,int max){ if(!root)return ; if(root- ......
节点 leetcode 1448 DFS BFS

LeetCode 热题 100 之 53. 最大子数组和

# 题目 给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 子数组 是数组中的一个连续部分。 **示例 1:** 输入:nums = [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的和最大, ......
数组 LeetCode 100 53

LeetCode 406. 根据身高重建队列

``` class Solution { public: struct node { int val; int pre; node* next; node(int a,int b,node* c) { val=a; pre=b; next=c; } }; void insert(node* &hea ......
队列 LeetCode 身高 406

[LeetCode] 2208. Minimum Operations to Halve Array Sum

You are given an array nums of positive integers. In one operation, you can choose any number from nums and reduce it to exactly half the number. (Not ......
Operations LeetCode Minimum Halve Array

leetcode第354场周赛 2 - 双指针

[题目传送门](https://leetcode.cn/contest/weekly-contest-354/) # [2779. 数组的最大美丽值](https://leetcode.cn/problems/maximum-beauty-of-an-array-after-applying-ope ......
指针 leetcode 354

LeetCode 热题 100 之 21. 合并两个有序链表

# 题目 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:** 输入:l1 = [1,2,4], l2 = [1,3,4] 输出:[1,1,2,3,4,4] **示例 2:** 输入:l1 = [], l2 = [] 输出:[] **示 ......
LeetCode 两个 100 21

LeetCode 热题 100 之 560. 和为 K 的子数组.md

# 题目 给你一个整数数组 nums 和一个整数 k ,请你统计并返回 该数组中和为 k 的连续子数组的个数 。 **示例 1:** 输入:nums = [1,1,1], k = 2 输出:2 **示例 2:** 输入:nums = [1,2,3], k = 3 输出:2 **提示:** 1 int ......
数组 LeetCode 100 560 md

[Leetcode Weekly Contest]355

链接:[LeetCode](https://leetcode-cn.com/contest/weekly-contest-355/) ## [Leetcode]6921. 按分隔符拆分字符串 给你一个字符串数组 words 和一个字符 separator ,请你按 separator 拆分 word ......
Leetcode Contest Weekly 355

LeetCode 热题 100 之 438. 找到字符串中所有字母异位词

# 题目 给定两个字符串 s 和 p,找到 s 中所有 p 的 异位词 的子串,返回这些子串的起始索引。不考虑答案输出的顺序。 异位词 指由相同字母重排列形成的字符串(包括相同的字符串)。 **示例 1:** 输入: s = "cbaebabacd", p = "abc" 输出: [0,6] 解释: ......
字符串 字母 字符 LeetCode 100

LeetCode 热题 100 之 3. 无重复字符的最长子串

# 题目 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: s = "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 示例 2: 输入: s = "bbbbb" 输出: 1 解释: 因为无重复字符的最长子串 ......
字符 LeetCode 100

LeetCode 399. 除法求值

``` class Solution { public: vector calcEquation(vector>& equations, vector& values, vector>& queries) { unordered_set node;//记录所有节点 unordered_map> g; ......
除法 LeetCode 399

LeetCode 周赛上分之旅 #34 按部就班地解决动态规划问题

> ⭐️ **本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 [彭旭锐] 和 [BaguTree Pro] 知识星球提问。** > > 学习数据结构与算法的关键在于掌握问题背后的算法思维框架,你的思考越抽象,它能覆盖的问题域就越广,理解难度也更复杂。在这个专栏里,小彭与你分享 ......
按部就班 LeetCode 之旅 动态 问题

LeetCode 周赛上分之旅 #35 两题坐牢,菜鸡现出原形

> ⭐️ **本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 [彭旭锐] 和 [BaguTree Pro] 知识星球提问。** > > 学习数据结构与算法的关键在于掌握问题背后的算法思维框架,你的思考越抽象,它能覆盖的问题域就越广,理解难度也更复杂。在这个专栏里,小彭与你分享 ......
原形 LeetCode 之旅 35

leetcode第109场双周赛

[题目传送门](https://leetcode.cn/contest/biweekly-contest-109/) # [6931. 访问数组中的位置使分数最大](https://leetcode.cn/problems/visit-array-positions-to-maximize-scor ......
leetcode 109

LeetCode 438. Find All Anagrams in a String 滑动窗口

Given two strings `s` and `p`, return an array of all the start indices of `p`'s anagrams in s. You may return the answer in any order. An Anagram is ......
LeetCode Anagrams String Find 438

leetcode第 109 场双周赛

## [6930. 检查数组是否是好的 - 力扣(LeetCode)](https://leetcode.cn/problems/check-if-array-is-good/) **首先判断数组长度是不是最大值 + 1, 然后排个序,判断0到n - 2是不是都是1到最大值的一个排列,满足这些返回t ......
leetcode 109

【优先队列】【堆排序实现优先队列】[1054. 距离相等的条形码](https://leetcode.cn/problems/distant-barcodes/)

#### 【优先队列】【堆排序实现优先队列】[1054. 距离相等的条形码](https://leetcode.cn/problems/distant-barcodes/) 在一个仓库里,有一排条形码,其中第 i 个条形码为 barcodes[i]。 请你重新排列这些条形码,使其中任意两个相邻的条形 ......

[LeetCode] 894. All Possible Full Binary Trees

Given an integer n, return a list of all possible full binary trees with n nodes. Each node of each tree in the answer must have Node.val == 0. Each e ......
LeetCode Possible Binary Trees Full

LeetCode 3. Longest Substring Without Repeating Characters 滑动窗口

Given a string `s`, find the length of the longest substring without repeating characters. ## Solution 用一个 $dict$ 来映射字符的次数。然后用 $left$, $right$ 来决定wind ......