总和leetcode 39
LeetCode 热题 100 之 160. 相交链表
# 题目描述 给你两个单链表的头节点 headA 和 headB ,请你找出并返回两个单链表相交的起始节点。如果两个链表不存在相交节点,返回 null 。 图示两个链表在节点 c1 开始相交:  和 (i, height[i]) 。 找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。 返回容器可以储存的最大水量。 说明:你不能倾斜容器。 示例 1: ,技术和职场问题,请关注公众号 [彭旭锐] 和 [BaguTree Pro] 知识星球提问。** > > 学习数据结构与算法的关键在于掌握问题背后的算法思 ......
leetcode day4 24 19 面试题02.07 142
[toc] #24. 两两交换链表中的节点  
``` 给你两个字符串 word1 和 word2 。请你从 word1 开始,通过交替添加字母来合并字符串。 如果一个字符串比另一个字符串长,就将多出来的字母追加到合并后字符串的末尾。 返回 合并后的字符串 。 输入:word1 = "abc", word2 = "pqr" 输出:"apbqcr" ......
Leetcode283. 移动零
``` class Solution { public: void moveZeroes(vector& nums) { if(nums.empty()) return; int n=nums.size(); int idx=n-1; while(idx>=0&&nums[idx]==0) idx- ......
Leetcode240.搜索二维矩阵II
``` class Solution { public: bool searchMatrix(vector>& matrix, int target) { if(matrix.empty()||matrix[0].empty()) return false; int n=matrix.size(), ......
[LeetCode] 1218. Longest Arithmetic Subsequence of Given Difference
Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that th ......
39.eval是做什么的
#### 39. eval 是做什么的? ``` 它的功能是把对应的字符串解析成 JS 代码并运行。 应该避免使用 eval,不安全,非常耗性能(2次,一次解析成 js 语句,一次执行)。 ``` 详细资料可以参考: [《eval()》](https://developer.mozilla.org/ ......
LeetCode 354. Russian Doll Envelopes 排序+LIS
You are given a 2D array of integers `envelopes` where `envelopes[i] = [wi, hi]` represents the width and the height of an envelope. One envelope can ......
配置问题-Error creating bean with name 'user' defined in class path resource [bean.xml]
正在学习 IoC 使用的 jdk 版本为 jdk 17 依赖为: ```xml org.springframework spring-core 6.0.6 org.springframework spring-context 6.0.9 org.junit.jupiter junit-jupiter ......
LeetCode 519. Random Flip Matrix 哈希Map
There is an `m x n` binary grid matrix with all the values set 0 initially. Design an algorithm to randomly pick an index `(i, j)` where `matrix[i][j] ......
【代码分享】使用 terraform, 在 Let's Encrypt 上申请托管在 cloudflare 上的域名对应的证书
**作者:张富春(ahfuzhang),转载时请注明作者和引用链接,谢谢!** * [cnblogs博客](https://www.cnblogs.com/ahfuzhang/) * [zhihu](https://www.zhihu.com/people/ahfuzhang/posts) * [G ......
【HMS Core】AR Engine中,运行时出现../../../../src/main/cpp/world_ar_application.h:30:10: fatal error: 'glm.hpp' file not found错误
【问题描述】 1、AR Engine中,从官网下载的“NDK示例代码”,运行时出现../../../../src/main/cpp/world_ar_application.h:30:10: fatal error: 'glm.hpp' file not found,该如何解决? 2、arengi ......
Git提交时出现Merge branch 'master' of ...之解决方法
多人协作开发项目,在上传代码时通常会先pull一下远程代码,使本地与远程同步更新,但是如果远程此时与自己代码存在冲突,在解决冲突后提交有时会出现“Merge branch ‘master’ of …”这条信息。这是因为pull其本质是fetch+Merge的结合。通常会分为以下两种情况: 1.如果远 ......
python ModuleNotFoundError: No module named 'flask'
### 问题: pip 安装了模块,提示 No module named ### 解决方法: 1.先看看模块列表里是否安装好了: ```bash pip list 模块名 ``` 2.看看模块安装路径: ```bash pip show 模块名 ``` 3.多个版本的 Python ,看看pip把包 ......
LeetCode 239. 滑动窗口最大值
``` class Solution { public: vector maxSlidingWindow(vector& nums, int k) { deque q; vector res; for(int i=0;i=k) q.pop_front(); //插入新元素 while(q.size( ......
mybatis if标签判断Integer类型的值不等于0 (!=''等价于!=0)
### 场景 当传入的`activityInfoDTO`属性`codeAction`的值为0时,需要通过状态`(code_action =0或1)`来查询数据,`code_action `类型为`Integer` ``` and code_action = #{activityInfoDTO.cod ......
antd from 表单中的key 不能绑定input中的字段 Input.js:207 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'value')
``` 删除 ```  不然则会出现 Input.js:207 Uncaught (in promise) Type ......
LeetCode 剑指 Offer 13. 机器人的运动范围
#题目链接:[LeetCode 剑指 Offer 13. 机器人的运动范围](https://leetcode.cn/problems/ji-qi-ren-de-yun-dong-fan-wei-lcof/) ##题意: **地上有一个m行n列的方格,从坐标 [0,0] 到坐标 [m-1,n-1] ......
QOJ 6504. CCPC Final 2022 D Flower's Land 2题解
# QOJ 6504. CCPC Final 2022 D Flower's Land 2题解 ## 题意简述 给你一个只含 $0,1,2$ 的序列,相邻两个相同的数字可以直接消掉。 询问包含两种 - 区间所有数 $+1$ 并对 $3$ 取模。 - 求一段区间能否用上述消除方式消完。 ### 样例输 ......
Vue3项目中import 'vue-native-websocket'出现错误
问题一: 问题二: 两个都搞不懂为什么、、可能自己基础太差,试了几个网上的解决方案都不行。 故转换角度:直接用原生WebSocket 参考地址:前后端使用利用WebSocket进行通信_F3nGaoXS的博客-CSDN博客 唔,还是原生的香…… ......