operations leetcode minimum halve

Leetcode 19. 删除链表的倒数第N个结点(Remove nth node from end of list)

[题目链接](https://leetcode.cn/problems/remove-nth-node-from-end-of-list) 给你一个链表, 删除链表的倒数第n个结点, 并且返回链表的头结点. 示例 1: ``` 输入:head = [1,2,3,4,5], n = 2 输出:[1,2 ......
结点 Leetcode Remove node from

Leetcode148 排序链表

148. 排序链表 - 力扣(LeetCode) /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr ......
Leetcode 148

LeetCode -- 151. 反转字符串中的单词(手写一个trim函数)

本题我们采用 class Solution { public: string reverseWords(string s) { stack<string> stk; int n = s.size(), l = 0, r = n - 1; //trim函数 while(l < n && s[l] == ......
字符串 单词 函数 字符 LeetCode

第 358 场周赛 - 力扣(LeetCode)

# [第 358 场周赛 - 力扣(LeetCode)](https://leetcode.cn/contest/weekly-contest-358/) ## [2815. 数组中的最大数对和 - 力扣(LeetCode)](https://leetcode.cn/problems/max-pai ......
LeetCode 358

【leetcode】404 左叶子之和

https://leetcode.cn/problems/sum-of-left-leaves/description/ 【分析】 该题要求左叶子之和。 如果我们对当前节点进行叶子节点的判断,那么我们是不知道当前节点是左叶子还是右叶子的。 所以我们应该在叶子结点的上层(父节点)进行判断。 【代码】 ......
之和 leetcode 叶子 404

[LeetCode] 2682. Find the Losers of the Circular Game

There are n friends that are playing a game. The friends are sitting in a circle and are numbered from 1 to n in clockwise order. More formally, movin ......
the LeetCode Circular Losers 2682

LeetCode -- 19. 删除链表的倒数第 N 个结点

一般的删除问题,可以直接删除(找符合条件的,找到了直接删掉),延迟删除(打标记,找完了再删除),栈,双指针 在链表中删除一个节点,要找到其前面一个节点cur, 然后 cur -> next = cur -> next -> next即可 方法一:直接删除 我们先算出链表长度len,要删除倒第n个节点 ......
结点 LeetCode 19

【LeetCode 571. 给定数字的频率查询中位数】WITH RECURSIVE实现Tally的逆操作

[TOC] # 题目地址 https://leetcode.cn/problems/find-median-given-frequency-of-numbers/description/ # 代码 ``` WITH RECURSIVE RecCTE AS ( SELECT num, frequenc ......
中位数 RECURSIVE 频率 LeetCode 数字

【leetcode】【401】二进制手表

https://leetcode.cn/problems/binary-watch/description/ 分析 这是典型的循环DFS问题。 循环DFS一般应用在: 1. 输出字符的按位全排列。(比如一共4个数字,输出3个数字的全部组合) 2. 输出字符的全排列。(结合visited数组) 3. ......
二进制 手表 leetcode 401

【LeetCode2308. 按性别排列表格】MySQL实现自定义排序

[TOC] # 题目地址 https://leetcode.cn/problems/arrange-table-by-gender/description/ # 题目描述 编写一个解决方案以重新排列 Genders 表,使行按顺序在 'female', 'other' 和 'male' 之间交替。同 ......
表格 LeetCode 性别 MySQL 2308

LeetCode -- 833. 字符串中的查找与替换 (延迟改变策略)

所谓延迟改变,可以是在应该改变的地方打一个标记,等把所有应该改变的地方都找到后,再进行操作。 class Solution { public: string findReplaceString(string s, vector<int>& indices, vector<string>& sourc ......
字符串 字符 LeetCode 策略 833

Go - Keywords, Operators and punctuation

Keywords The following keywords are reserved and may not be used as identifiers. break default func interface select case defer go map struct chan els ......
punctuation Operators Keywords and Go

Leetcode 206. 反转链表(Reverse linked list)

[题目链接](https://leetcode.cn/problems/reverse-linked-list) 给你单链表的头节点 head ,请你反转链表,并返回反转后的链表。 示例 1: ``` 输入:head = [1,2,3,4,5] 输出:[5,4,3,2,1] ``` 示例 2: `` ......
Leetcode Reverse linked list 206

operator bool 函数

title: "operator bool 函数" date: 2023-08-14T16:05:25+08:00 tags: ["C++"] categories: [] draft: false # 参考文档 [user-defined conversion function - cpprefe ......
函数 operator bool

[LeetCode] 2369. Check if There is a Valid Partition For The Array

You are given a 0-indexed integer array nums. You have to partition the array into one or more contiguous subarrays. We call a partition of the array  ......
Partition LeetCode Check Array There

LLMOps(Large Language Model Operations)简介

LLMOps是一个新兴领域,专注于管理大型语言模型的整个生命周期,包括数据管理、模型开发、部署和伦理等方面。Hugging Face、Humanloop和NVIDIA等公司正在引领这一领域的发展。 Hugging Face的Transformers库已成为构建和微调各种NLP任务的大型语言模型的首选 ......
Operations Language 简介 LLMOps Large

Leetcode 203. 移除链表元素(Remove linked list elements)

[题目链接](https://leetcode.cn/problems/remove-linked-list-elements) 给你一个链表的头节点head和一个整数val , 请你删除链表中所有满足Node.val == val的节点, 并返回新的头节点. 示例 1: ``` 输入:head = ......
Leetcode elements 元素 Remove linked

LeetCode 7023操作使得分最大

# [7023. 操作使得分最大](https://leetcode.cn/problems/apply-operations-to-maximize-score/) 题目描述:一个数字的质数分数为其质因数个数;给定一个长度为$n$的正整数数组`nums`和正整数`k`,可以进行`k`次如下操作: ......
得分 LeetCode 7023

Leetcode No.53 Maximum Subarray

参考资料: 考点:子串 & 动态规划 & [题干] Input: nums = [-2,1,-3,4,-1,2,1,-5,4] Output: 6 Explanation: The subarray [4,-1,2,1] has the largest sum 6. 1. 心路历程 这道题非常经典, ......
Leetcode Subarray Maximum 53 No

LeetCode 周赛上分之旅 #39 结合中心扩展的单调栈贪心问题

> ⭐️ **本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 \[彭旭锐] 和 [BaguTree Pro](https://www.mdnice.com/writing/85b28c4e60354865a423728e668fc570) 知识星球提问。** > > 学习数据 ......
LeetCode 之旅 问题 39

LeetCode 7022——熟悉TreeSet数据结构及常用方法的使用

LeetCode 7022. 限制条件下元素之间的最小绝对差 题目描述: 给你一个下标从 0 开始的整数数组 nums 和一个整数 x 。 请你找到数组中下标距离至少为 x 的两个元素的 差值绝对值 的 最小值 。 换言之,请你找到两个下标 i 和 j ,满足 abs(i - j) >= x 且 a ......
数据结构 LeetCode 常用 TreeSet 结构

C++STL库 二分查找,以及对set集合进行二分查找,来源于”leetcode7022. 限制条件下元素之间的最小绝对差“

C++的头文件<algorithm>中有用于二分查找的函数,lower_bound()、upper_bound()以及binary_search(): lower_bound():返回大于等于目标值的第一个位置upper_bound():返回大于目标值的第一个位置,binary_search():若 ......
leetcode 元素 条件 之间 来源

Leetcode 209. 长度最小的子数组(Minimum size subarray sum)

[题目链接](https://leetcode.cn/problems/minimum-size-subarray-sum) 给定一个含有 n 个正整数的数组和一个正整数 target 。 找出该数组中满足其和 ≥ target 的长度最小的 连续子数组 [numsl, numsl+1, ..., ......
数组 长度 Leetcode subarray Minimum

LeetCode--1039

Smiling & Weeping 我总是躲在梦与季节的身处, 听花与黑夜唱尽梦魇, 唱尽繁华,唱断所有记忆的来路。 题目链接:1039. 多边形三角剖分的最低得分 - 力扣(LeetCode) 题目描述: 你有一个凸的 n 边形,其每个顶点都有一个整数值。给定一个整数数组 values ,其中 v ......
LeetCode 1039

k8s etcd operator

在k8s生态中,Operator是灵活管理有状态应用的解决方案。operator通过crd来描述部署的有状态应用和自定义控制器来完成部署和运维工作。 EtcdOperator部署Etcd集群,采用的是静态集群的方式。好处是不必依赖一个额外的服务发现机制来组建集群,适合本地容器化部署。难点在于部署时规 ......
operator etcd k8s k8 8s

Leetcode 977. 有序数组的平方(Squares of a sorted array)

[题目链接](https://leetcode.cn/problems/squares-of-a-sorted-array) 给你一个按**非递减顺序**排序的整数数组nums, 返回每个数字的平方组成的新数组, 要求也按**非递减顺序**排序. 示例 1: ``` 输入:nums = [-4,-1 ......
数组 Leetcode Squares sorted array

Leetcode 27. 移除元素(Remove Element)

[题目链接](https://leetcode.cn/problems/remove-element) 给你一个数组nums和一个值val, 你需要**原地**移除所有数值等于val的元素, 并返回移除后数组的新长度. 不要使用额外的数组空间, 你必须仅使用O(1)额外空间并**原地**修改输入数组 ......
Leetcode 元素 Element Remove 27

Leetcode167. 两数之和 II - 输入有序数组(双指针)

题目: [ 两数之和 II - 输入有序数组(双指针)](https://leetcode.cn/problems/two-sum-ii-input-array-is-sorted/description/) 给你一个下标从 1 开始的整数数组 numbers ,该数组已按 非递减顺序排列 ,请你从 ......
之和 数组 指针 Leetcode 167

LeetCode -- 827. 最大人工岛

题目大意:给一个邻接矩阵,问改变一个点后,最大连通块多大 对于这种连通块相关问题,一般的思路就是进行深搜和并查集,这里采用并查集维护连通块大小解法。 首先先初始化并查集,并进行连通块的合并;再对图中的0进行枚举,找到最大的连通块即可。 对(n * m)的二维点阵图常用技巧,二维转一维:点(i, j) ......
人工岛 人工 LeetCode 827

LeetCode从算法到算命—1281.整数的各位积和之差(20230809)

# 1281.整数的各位积和之差 ## 题目信息 给你一个整数 `n`,请你帮忙计算并返回该整数「各位数字之积」与「各位数字之和」的差。 **示例 1:** ``` 输入:n = 234 输出:15 解释: 各位数之积 = 2 * 3 * 4 = 24 各位数之和 = 2 + 3 + 4 = 9 结 ......
整数 算法 LeetCode 20230809 1281