总和leetcode 39

报错:go: go.mod file not found in current directory or any parent directory; see 'go help modules'

报错:go: go.mod file not found in current directory or any parent directory; see 'go help modules' 知识补充: ......
directory go current modules parent

[LeetCode] 1352. Product of the Last K Numbers 最后 K 个数的乘积

Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream. Implement the ProductOfNumbers c ......
乘积 个数 LeetCode Product Numbers

Leetcode 1193. 每月交易Ⅰ

1193. 每月交易Ⅰ 题目 表:Transactions + + + | Column Name | Type | + + + | id | int | | country | varchar | | state | enum | | amount | int | | trans_date | d ......
Leetcode 1193

Excel导出时文件中没有内容,表格是空的,并且后台抛出了下面的错误:No converter for [class com.common.dto.CommonResult] with preset Content-Type 'application/vnd.ms-excel;charset=utf-8'

【问题描述】 Excel导出时文件中没有内容,表格是空的,并且后台抛出了下面的错误: 2023-09-14 09:48:59.876 WARN 7 [http-nio-8096-exec-3] .m.m.a.ExceptionHandlerExceptionResolver : Failure in ......

[LeetCode] 85. Maximal Rectangle_Hard tag: Dynamic Programming

Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example 1: Input: matri ......

leetcode 二叉树的最大深度

给定一个二叉树 root ,返回其最大深度。 二叉树的 最大深度 是指从根节点到最远叶子节点的最长路径上的节点数。 示例 1: 输入:root = [3,9,20,null,null,15,7] 输出:3 示例 2: 输入:root = [1,null,2] 输出:2 解题思路 这里可以转化思路为 ......
深度 leetcode

Leetcode(Hash)

1.the sum of two nums 1.1Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. 1.2 ......
Leetcode Hash

2023-09-13:用go语言,给定一个整数数组 nums 和一个正整数 k, 找出是否有可能把这个数组分成 k 个非空子集,其总和都相等。 输入: nums = [4, 3, 2, 3, 5,

2023-09-13:用go语言,给定一个整数数组 nums 和一个正整数 k, 找出是否有可能把这个数组分成 k 个非空子集,其总和都相等。 输入: nums = [4, 3, 2, 3, 5, 2, 1], k = 4。 输出: True。 来自左程云。 答案2023-09-13: 第一种算法( ......
整数 组分 空子 数组 nums

'str' object has no attribute 'strftime'

错误原因: 该错误通常出现Pyhton的日期和时间格式化的过程中,因为strftime是将日期格式化输出的函数,该函数属于datetime库中datetime类的函数。出现该错误的原因是:变量是字符串类型的日期,而字符串类型是没有strftime函数的。 解决方法: 如果你想要对一个字符串类型的日期 ......
39 attribute strftime object str

application 'vueApp' died in status NOT_MOUNTED: [qiankun]: Target container with #vue not existed after vueApp mounted!

这是第一次微前端很常见的提示,尤其是第一次写前端的时候碰到的 解决1:主应用的 App.vue标签上的id="app"去掉,这是报错的根本解决2: // 在子应用挂在的时候处理 function render(props = {}) { const { container } = props; in ......

Leetcode 27. 移除元素

题目描述 给你一个数组 nums 和一个值 val,你需要 原地 移除所有数值等于 val 的元素,并返回移除后数组的新长度。 不要使用额外的数组空间,你必须仅使用 O(1) 额外空间并 原地 修改输入数组。 元素的顺序可以改变。你不需要考虑数组中超出新长度后面的元素。 双指针 Python 实现 ......
Leetcode 元素 27

leetcode547省份数量

深度优先搜索 vector<bool>vis; int num=0; void dfs(vector<vector<int>>& isConnected,int x){ vis[x]=true; for(int i=0;i<isConnected[x].size();i++){ if(!vis[i] ......
省份 leetcode 数量 547

git报错解决,warning: could not find UI helper 'git-credential-manager-ui'

在克隆远程代码时,可能遇到这样的报错 warning: could not find UI helper 'git-credential-manager-ui' 这样的报错经常会在我们换了一台电脑或者更换一次开发环境后使用git克隆远程仓库时出现 原因是我们使用git时可能不弹出提示框提示我们输入G ......

LeetCode -- 1462. 课程表 IV (拓扑排序,二进制集合)

本题我们要快速的判断一个点在拓扑序中是不是另一个点的前驱,先求出拓扑序,在利用二进制代表集合来进行前驱的判断。 class Solution { public: const static int N = 110, M = N * N; int h[N], e[M], ne[M], idx; int ......
课程表 拓扑 二进制 LeetCode 课程

算法训练day7 LeetCode454

算法训练day7: LeetCode454.383.15.18 454.四数相加 题目 454. 四数相加 II - 力扣(LeetCode) 题解 代码随想录 (programmercarl.com) class Solution { public: int fourSumCount(vector ......
算法 LeetCode day7 day 454

Vue编译出现This file is being treated as an ES module because it has a '.js' file extension错误

问题描述 在编译前端项目时出现下面的问题: Failed to load PostCSS config: Failed to load PostCSS config (searchPath: D:/WebProject/imooc-front): [Failed to load PostCSS co ......
file extension 错误 because treated

【Leetcode】解题报告Day1~Day2

解题报告 Day1 1. 2235.两数之和 给你两个整数 num1 和 num2,返回这两个整数的和。 示例 1: 输入:num1 = 12, num2 = 5 输出:17 解释:num1 是 12,num2 是 5 ,它们的和是 12 + 5 = 17 ,因此返回 17 。 示例 2: 输入:n ......
Day Leetcode 报告 Day1 Day2

SQLAlchemy: What's the difference between flush() and commit()?

SQLAlchemy: What's the difference between flush() and commit()? https://pyquestions.com/sqlalchemy-what-s-the-difference-between-flush-and-commit A Se ......
SQLAlchemy difference between commit flush

AttributeError: 'int' object has no attribute 'items' 混合数据存储

data = { '2023:09:01': {'867726032728067': 68}, '2023:09:02': {'867726032728067': 68}, '2023:09:03': 0, '2023:09:04': {'866384064965578': 48, '8672660 ......
39 AttributeError attribute 数据 object

LeetCode 1934.确认率

1934.确认率 1.问题关键精炼: 确认率是confirmed消息的数量除以请求的确认消息的总数。 没有请求任何确认消息的用户的确认率为0。 确认率四舍五入到小数点后两位 2.难点解析: 我觉得这道题是考察AVG函数的使用。 根据需求可以看出,答案也就是一个公式:confirmed消息的数量 / ......
LeetCode 1934

出现这样的报错,该如何处理cannot import name 'soft_unicode' from 'markupsafe' (d:\python39\lib\site-packages\markupsafe\__init__.py)

在使用httprunner学习接口测试的过程中,刚开始学习的是har2case。通过这个将文件转化成yml或者json的格式,在写完一个以yml为后缀的代码后,运行时出现了报错 ERROR No Valid testcases found,exit 1,然后通过尝试多种方法,比如卸载了httprun ......

vite 打包报错 SyntaxError: Unexpected token '??='

'??' Nullish coalescing Operator 是ECMAScript 2019年的已被采纳的提案,需要 Node.js 15以上才支持。 因此需要升级本地的 Node.js 版本,推荐使用nvm管理本地 Node.js 版本。 参考资料 1、ECMAScript已经完成的提案 2 ......
SyntaxError Unexpected token vite 39

Day39(2023.08.29)

行程 8:45 到达上海市信息安全测评认证中心(黄浦区陆家浜路1308号) 9:00 漏洞学习 11:30--13:00 吃饭休息 13:00 漏洞学习 17:00 下班 ......
2023 Day 39 08 29

leetcode841钥匙和房间

使用深度优先遍历构造的图,只要访问过就标记已访问 int num=0; vector<bool>vis; void dfs(vector<vector<int>>& rooms,int x){ vis[x]=true; num++; for(auto& v:rooms[x]){ if(!vis[v] ......
leetcode 钥匙 房间 841

关于Spring i18n国际化 报错No message found under code * for locale 'zh_CN'.的解决方案

第一步 创建资源文件 国际化文件命名格式:基本名称 _ 语言 _ 国家.properties 这里我建了两个配置文件,一个是zh_CN中文的,一个是en_GB英文的,然后在里面随便写点测试文本语句 第二步 bean.xml spring配置文件 1 <?xml version="1.0" encod ......
解决方案 message 方案 Spring locale

leetcode450删除搜索二叉树的节点

删除的二叉树节点分4种情况: 叶子节点,直接删除就行 左节点不为空,右节点为空;直接将左子树返回 左节点为空,右节点不为空;直接将右子树返回 左节点和右节点不为空;将右子树最小的节点作为根节点,返回右子树 TreeNode* deleteNode(TreeNode* root, int key) { ......
节点 leetcode 450

Leetcode 26. 删除有序数组中的重复项

题目描述 给你一个 升序排列 的数组 nums ,请你 原地 删除重复出现的元素,使每个元素 只出现一次 ,返回删除后数组的新长度。元素的 相对顺序 应该保持 一致 。然后返回 nums 中唯一元素的个数。 双指针 Python 实现 def removeDuplicates(nums: List[ ......
数组 Leetcode 26

LeetCode287——寻找重复数

给定一个包含 n + 1 个整数的数组 nums ,其数字都在 [1, n] 范围内(包括 1 和 n),可知至少存在一个重复的整数。 假设 nums 只有 一个重复的整数 ,返回 这个重复的数 。 你设计的解决方案必须 不修改 数组 nums 且只用常量级 O(1) 的额外空间。 示例 1: 输入 ......
LeetCode 287

LeetCode523——连续的子数组和

给你一个整数数组 nums 和一个整数 k ,编写一个函数来判断该数组是否含有同时满足下述条件的连续子数组: 子数组大小 至少为 2 ,且 子数组元素总和为 k 的倍数。 如果存在,返回 true ;否则,返回 false 。 如果存在一个整数 n ,令整数 x 符合 x = n * k ,则称 x ......
数组 LeetCode 523

leetcode - 翻转二叉树

给你一棵二叉树的根节点 root ,翻转这棵二叉树,并返回其根节点。 示例 1: 输入:root = [4,2,7,1,3,6,9] 输出:[4,7,2,9,6,3,1] 示例 2: 输入:root = [2,1,3] 输出:[2,3,1] 示例 3: 输入:root = [] 输出:[] 这题比较 ......
leetcode