hard-leetcode leetcode hard 25

[Leetcode] 0014. 最长公共前缀

# [14. 最长公共前缀](https://leetcode.cn/problems/longest-common-prefix) 点击上方,跳转至Leetcode ## 题目描述 编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀,返回空字符串 ""。 示例 1: 输入:strs ......
前缀 Leetcode 0014

[Leetcode] 0020. 有效的括号

# [20. 有效的括号](https://leetcode.cn/problems/valid-parentheses) 点击上方,跳转至leetcode ## 题目描述 给定一个只包括 '(',')','{','}','[',']' 的字符串 s ,判断字符串是否有效。 有效字符串需满足: 左括 ......
括号 Leetcode 0020

[Leetcode] 0009. 回文数

# [9. 回文数](https://leetcode.cn/problems/palindrome-number) 点击上方,跳转至Leetcode ## 题目描述 给你一个整数 x ,如果 x 是一个回文整数,返回 true ;否则,返回 false 。 回文数是指正序(从左向右)和倒序(从右向 ......
回文 Leetcode 0009

[Leetcode] 0013. 罗马数字转整数

# [13. 罗马数字转整数](https://leetcode.cn/problems/roman-to-integer) 点击上方,跳转至leetcode ## 题目描述 罗马数字包含以下七种字符: I, V, X, L,C,D 和 M。 字符 数值 I 1 V 5 X 10 L 50 C 10 ......
整数 Leetcode 数字 0013

[Leetcode] 0728. 自除数

# [728. 自除数](https://leetcode.cn/problems/self-dividing-numbers) 点击上方,跳转至leetcode ## 题目描述 自除数 是指可以被它包含的每一位数整除的数。 例如,128 是一个 自除数 ,因为 128 % 1 == 0,128 % ......
除数 Leetcode 0728

[Leetcode] 0733. 图像渲染

# [733. 图像渲染](https://leetcode.cn/problems/flood-fill) 点击上方,跳转至leetcode ## 题目描述 有一幅以 m x n 的二维整数数组表示的图画 image ,其中 image[i][j] 表示该图画的像素值大小。 你也被给予三个整数 s ......
Leetcode 图像 0733

[Leetcode] 0724. 寻找数组的中心下标

# [724. 寻找数组的中心下标](https://leetcode.cn/problems/find-pivot-index) 点击上方,跳转至leetcode ## 题目描述 给你一个整数数组 nums ,请计算数组的 中心下标 。 数组 中心下标 是数组的一个下标,其左侧所有元素相加的和等于 ......
下标 数组 Leetcode 0724

[Leetcode] 0709. 转换成小写字母

# [709. 转换成小写字母](https://leetcode.cn/problems/to-lower-case) 点击上方跳转至Leetcode ## 题目描述 给你一个字符串 s ,将该字符串中的大写字母转换成相同的小写字母,返回新的字符串。 示例 1: 输入:s = "Hello" 输出 ......
小写 字母 Leetcode 0709

[Leetcode] 0717. 1 比特与 2 比特字符

# [717. 1 比特与 2 比特字符](https://leetcode.cn/problems/1-bit-and-2-bit-characters) 点击上方,跳转至leetcode ## 题目描述 有两种特殊字符: 第一种字符可以用一比特 0 表示 第二种字符可以用两比特(10 或 11) ......
字符 Leetcode 0717

[Leetcode] 0706. 设计哈希映射

# [706. 设计哈希映射](https://leetcode.cn/problems/design-hashmap) 点击跳转至leetcode ## 题目描述 不使用任何内建的哈希表库设计一个哈希映射(HashMap)。 实现 MyHashMap 类: MyHashMap() 用空映射初始化对 ......
Leetcode 0706

1595. 连通两组点的最小成本 (Hard)

问题描述 1595. 连通两组点的最小成本 (Hard) 给你两组点,其中第一组中有 size₁ 个点,第二组中有 size₂ 个点,且 size₁ >= size₂ 。 任意两点间的连接成本 cost 由大小为 size₁ x size₂ 矩阵给出,其中 cost[i][j] 是第一组中的点 i ......
成本 1595 Hard

1595. Minimum Cost to Connect Two Groups of Points] (Hard)

Description 1595. Minimum Cost to Connect Two Groups of Points (Hard) You are given two groups of points where the first group has size1 points, the s ......
Minimum Connect Groups Points 1595

CF958C3. Encryption (hard)

谁说 $n\le5\times 10^5$,$k\le100$,$p\le100$ 只能 $O(nk)$?我今天就要用 $O(nk\log p)$ 过这个题! 定义 $f_{i,j}$ 表示前 $j$ 个数,分成 $i$ 段的最小价值和,$s_i$ 表示前缀和(对 $p$ 取模),转移就是 $f_{ ......
Encryption hard 958 CF C3

(Leetcode)将数组按照绝对值大小从大到小排序

【少说多做,少想多做】 ```java nums = IntStream.of(nums). boxed(). sorted((o1,o2)->Math.abs(o2)-Math.abs(o1)) .mapToInt(Integer::intValue).toArray(); ``` + IntSt ......
绝对值 数组 Leetcode 大小

[LeetCode] 2090. K Radius Subarray Averages

You are given a 0-indexed array nums of n integers, and an integer k. The k-radius average for a subarray of nums centered at some index i with the ra ......
LeetCode Averages Subarray Radius 2090

每日一题力扣 1262 https://leetcode.cn/problems/greatest-sum-divisible-by-three/

、 题解 这道题目核心就算是要知道如果x%3=2的话,应该要去拿%3=1的数字,这样子才能满足%3=0 贪心 sum不够%3的时候,就减去余数为1的或者余数为2的 需要注意 两个余数为1会变成余数为2的,所以可能减去2个余数为1 核心代码如下 public int maxSumDivThreeOth ......

Min-25 筛学习笔记

# Min-25 筛学习笔记 $\text{By DaiRuiChen007}$ ## 一、简要介绍 Min-25 筛,是一种能在**亚线性**时间内求出特定的一类积性函数 $f(i)$ 的前缀和的算法。 具体来说,Min-25 筛可以在 $\mathcal O(\sqrt n)$ 的空间复杂度与 ......
笔记 Min 25

[LeetCode] 1262. Greatest Sum Divisible by Three

Given an integer array nums, return the maximum possible sum of elements of the array such that it is divisible by three. Example 1: Input: nums = [3, ......
Divisible LeetCode Greatest Three 1262

nginx 1.25. 1 发布

nginx 1.25.1 有一个很不错的特性,就是支持了http2 指令,以前这个指令主要是也listen 配置使用的(ssl+http2 场景) 独立指令之后就有了很方便的功能了,比如有些业务希望使用http0.9-1.1 协议,有些需要使用http2,当然目前也是支持了 http3的,可以做到分 ......
nginx 25

阶段性知识总结解释版【Day01-Day25】

# day02 ## 1.什么是编程和编程语言 ```python 编程 是指使用计算机语言编写计算机程序的过程。 编程语言 是一种用于编写计算机程序的形式化语言,它可以被解释器或编译器转换成机器码以便计算机执行。 编程语言包括C、Java、Python、JavaScript、PHP等。 ``` # ......
阶段性 Day 阶段 知识 01

阶段性知识总结习题版【Day01-Day25】

# day02 1. 什么是编程和编程语言 2. 计算机五大组成部分,分别阐释一下各自特点 3. 计算机三大核心硬件,各自的特点 4. 常见的操作系统 # day03 1. 计算机存储数据的单位有哪些,之间的单位换算是怎样的 2. 编程语言的发展史,分别有什么特点 3. 编程语言的分类 4. pyt ......
阶段性 习题 Day 阶段 知识

RT-THREAD的SFUD驱动简介基于W25Q128

##SFUD简介 [SFUD](https://github.com/armink/SFUD)是一款开源的串行 SPI Flash 通用驱动库。 详细介绍可查看官方说明,作为一个通用的中间套件,帮用户屏蔽了底层的FLASH操作,也方便用户使用不同的FLASH时进行移植。 只需要配置好SPI就可以完成 ......
RT-THREAD W25Q128 简介 THREAD Q128

从3000ms到25ms!看看人家的接口优化技巧,确实很优雅!!

- 批处理 > 避免多次IO - 异步处理 - 空间换时间 > 使用缓存 - 预处理 > 预计算 - 池化思想 > 数据库连接池,线程池。避免重复创建与销毁。 - 优化程序结构 > 程序经过多次迭代,多人维护开发情况下,会出现一些重复操作等等。 - 串行改并行 - 索引 > 加索引,排除索引失效场景 ......
接口 技巧 3000 ms 25

LeetCode 周赛 350(2023/06/18)01 背包变型题

> **本文已收录到 [AndroidFamily](https://github.com/pengxurui/AndroidFamily),技术和职场问题,请关注公众号 [彭旭锐] 和 [BaguTree Pro] 知识星球提问。** - 往期回顾:[LeetCode 单周赛第 348 场 · 数 ......
背包 LeetCode 2023 350 06

1494. 并行课程 II (Hard)

问题描述 1494. 并行课程 II (Hard) 给你一个整数 n 表示某所大学里课程的数目,编号为 1 到 n ,数组 relations 中, relations[i] = [xᵢ, yᵢ] 表示一个先修课的关系,也就是课程 xᵢ 必须在课程 yᵢ 之前上。同时你还有一个整数 k 。 在一个学 ......
课程 1494 Hard II

1494. Parallel Courses II (Hard)

Description 1494. Parallel Courses II (Hard) You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also gi ......
Parallel Courses 1494 Hard II

min_25筛小记

不太清楚这东西的复杂度( 我们将这个题分成两个部分,先求所有质数的函数值之和,然后求所有数的函数值之和。 对于质数来说,这个函数就是一个多项式,将所有项分开考虑。我们假设现在所有数的函数都是这样的,只不过最后只保留质数的答案。 现在有一个很开脑洞的思路,就是设 $S(n,k)$ 表示在前 $n$ 个 ......
小记 min 25

552.Student Attendance Record II (Hard)

Description 552. Student Attendance Record II (Hard) An attendance record for a student can be represented as a string where each character signifies ......
Attendance Student Record Hard 552

1483. Kth Ancestor of a Tree Node (Hard)

Description 1483. Kth Ancestor of a Tree Node (Hard) You are given a tree with n nodes numbered from 0 to n - 1 in the form of a parent array parent w ......
Ancestor 1483 Hard Tree Node