leetcode错误 版本278
docker拉取镜像错误missing signature key
Centos7,使用docker拉取的时候,报错信息:missing signature key 解决: 1、复制下面的内容 yum erase docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest ......
[LeetCode Hot 100] LeetCode73. 矩阵置零
题目描述 思路一:开辟两个数组,时间复杂度O(m + n) 开辟两个数组用来记录哪些行、哪些列需要置为零。 这样时间复杂度为O(m + n)。 思路二: 原地算法:不适用额外空间或者说常数级空间来实现算法。 类似于使用set保存每行每列是否需要置零, 方法一:对应思路一 class Solution ......
Packet.dll使用错误报错——应用程序无法正常启动(0xc000007b)
程序打开报错: 解决方案:替换Packet.dll 1 System32 和 SysWOW64 在 Windows 操作系统中的反直觉存放 ......
最新版本——Hadoop3.3.6单机版完全部署指南
大家好,我是独孤风,大数据流动的作者。 本文基于最新的 Hadoop 3.3.6 的版本编写,带大家通过单机版充分了解 Apache Hadoop 的使用。本文更强调实践,实践是大数据学习的重要环节,也能在实践中对该技术有更深的理解,所以一些理论知识建议大家多阅读相关的书籍(都在资料包中)。 本文档 ......
KubeKey 升级 KubeSphere 和 Kubernetes 补丁版本实战指南
作者:运维有术 前言 知识点 定级:入门级 KubeKey 如何升级 KubeSphere 补丁版本 KubeKey 如何升级 Kubernetes 补丁版本 KubeSphere 和 Kubernetes 升级准备及验证 KubeKey 升级 KubeSphere 和 Kubernetes 的常见 ......
leetcode-1662-easy
Check If Two String Arrays are Equivalent 思路一:把第一个数组入队列,然后遍历比较第二个数组 public boolean arrayStringsAreEqual(String[] word1, String[] word2) { Deque<Charac ......
leetcode-1732-easy
Find the Highest Altitude 思路一:直接遍历 public int largestAltitude(int[] gain) { int val = 0; int max = val; for (int i : gain) { val += i; max = Math.max( ......
leetcode-1646-easy
Get Maximum in Generated Array You are given an integer n. A 0-indexed integer array nums of length n + 1 is generated in the following way: nums[0] = ......
leetcode-2169-easy
Count Operations to Obtain Zero You are given two non-negative integers num1 and num2. In one operation, if num1 >= num2, you must subtract num2 from ......
leetcode-2180-easy
Count Integers With Even Digit Sum Given a positive integer num, return the number of positive integers less than or equal to num whose digit sums are ......
leetcode-1455-easy
Check If a Word Occurs As a Prefix of Any Word in a Sentence Given a sentence that consists of some words separated by a single space, and a searchWor ......
leetcode-1464-easy
Maximum Product of Two Elements in an Array Given the array of integers nums, you will choose two different indices i and j of that array. Return the ......
leetcode-1512-easy
Number of Good Pairs Given an array of integers nums, return the number of good pairs. A pair (i, j) is called good if nums[i] == nums[j] and i < j. E ......
leetcode-1550-easy
Three Consecutive Odds Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false. Examp ......
leetcode-1572-easy
Matrix Diagonal Sum Given a square matrix mat, return the sum of the matrix diagonals. Only include the sum of all the elements on the primary diagona ......
[LeetCode] 1688. Count of Matches in Tournament
You are given an integer n, the number of teams in a tournament that has strange rules: If the current number of teams is even, each team gets paired ......
Leetcode 80. 删除有序数组中的重复项 II
被前面类似的题禁锢了思路,自己写的双指针,感觉题解很巧妙,记录一下。这个解法不用记录cnt。 通用解法 为了让解法更具有一般性,我们将原问题的「保留 2 位」修改为「保留 k 位」。 对于此类问题,我们应该进行如下考虑: 由于是保留 k 个相同数字,对于前 k 个数字,我们可以直接保留 对于后面的任 ......
Leetcode刷题day6-哈希表.双指针.三~四数求和.
454.四数相加Ⅱ 454. 四数相加 II - 力扣(LeetCode) 给你四个整数数组 nums1、nums2、nums3 和 nums4 ,数组长度都是 n ,请你计算有多少个元组 (i, j, k, l) 能满足: 0 <= i, j, k, l < n nums1[i] + nums2[ ......
[LeetCode Hot 100] LeetCode19. 删除链表的倒数第N个结点
题目描述 思路一:采用两次遍历 第一遍遍历先获取链表的长度length 第二次从dummy节点开始走length - n步 然后将该节点指向下下个节点 思路二:采用一次遍历 设置虚拟节点dummyHead指向head 设定双指针p和q,初始都指向虚拟节点dummyHead 移动q,直到p与q之间相隔 ......
[LeetCode Hot 100] LeetCode21. 合并两个有序链表
题目描述 思路:新建dummy去"穿针引线" 新建一个dummy节点去"穿针引线" 注意最后返回的是dummy.next 方法一: /** * Definition for singly-linked list. * public class ListNode { * int val; * List ......
从github下拷贝文件时出现SSL证书错误
解决方式:解除ssl验证后,再次git即可 git config --global http.sslVerify false ......
CentOS7升级内核版本,以及解决升级内核后网卡不能使用的问题
CentOS7.9自带的内核版本为3.1,没有wireguard模块,遂决定升级内核版本 第一步升级内核,参考 https://www.cnblogs.com/iwalkman/p/9736856.html 除了内核还需要安装 kernel-ml-devel,否则待会编译网卡驱动会报错 yum -- ......
nginx版本升级之rpm包-nginx 安全漏洞(CVE-2021-23017)
nginx 安全漏洞(CVE-2021-23017) 原版本 nginx-1.19.6-1.el7.ngx.x86_64.rpm 要升级的版本 nginx-1.20.1-1.el7.ngx.x86_64.rpm 1.下载nginx-1.20.1-1.el7.ngx.x86_64.rpm 官网下载地址 ......
.Net各版本的区别
简介: .NET 是一个跨平台的开发框架,它提供了一系列工具和库,用于开发各种类型的应用程序。在不同的 .NET 版本之间,存在一些区别和改进。下面是几个常见的 .NET 版本及其主要区别的概述: .NET Framework: .NET Framework 是最早发布的 .NET 版本,它主要用于 ......
可靠信号与不可靠信号,大部分文章都是错误的
关于操作系统的信号,一直是比较难于理解容易出错的地方关于可靠信号与不可靠信号,网络上大部分文章相互抄袭,都是错的本文在深度参考了APUE和TLPI,试图说清楚这两者的差异 一· 可靠信号与不可靠信号 早期的signal函数 在首次注册前没有办法使用屏蔽字让信号保持未决,此信号也容易丢失 在每次信号处 ......
【C语言调用Python】Py_Finalize() 时报 GC 崩溃错误。
Py_Finalize() 时报 GC 崩溃错误。 记一次有趣的报错随笔。 报错现场 在使用如下的报错代码时,在释放阶段调用Py_Finalize(),报如下Assert崩溃。 原因 结论 在调用函数逻辑里的Exit0中,对变量pModuleDict和pClass进行了手动释放,引用计数-1(宏KL ......
记一次K8S项目flanneld启动失败错误
node节点启动falnneld失败,查看日志有以下报错信息 /var/log/message 报错信息 certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" whi ......
IntelliJ IDEA 2023 又出新版本啦!最新IDEA激活码安排上「永久激活,长期更新,亲测有效」
IntelliJ IDEA 2023.2.5版也正式发布了。它是公认的最好的Java开发工具。本文提供最新idea2023激活码。关注公众号【程序视点】,回复:cccc222, 免费获取。最新idea激活码,一步破解,永久激活,亲测有效,全年有效。 ......
[LeetCode Hot 100] LeetCode234. 回文链表
题目描述 思路1:将值复制到数组中然后使用双指针 计算链表的长度 创建等长的数组 将链表中的数依次放入数组中 使用左右指针判断链表是否是回文链表 时间复杂度:O(n) 空间复杂度:O(n) 思路2:快慢指针+反转链表 用快慢指针,快指针走两步,慢指针走一步,快指针遇到终止位置时,慢指针就在链表中间位 ......
[LeetCode Hot 100] LeetCode206. 反转链表
题目描述 思路:双指针算法 方法一: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNode(int val) ......