总和leetcode 39
LeetCode 90. 子集 II
``` class Solution { public: unordered_map cnt; vector> res; vector path; vector> subsetsWithDup(vector& nums) { for(auto i:nums) cnt[i]++; dfs(-10);/ ......
【leetcode】104. Maximum Depth of Binary Tree
给定一个二叉树,找出其最大深度。 二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 **说明:** 叶子节点是指没有子节点的节点。 **示例:** 给定二叉树 `[3,9,20,null,null,15,7]`, ``` 3 / \ 9 20 / \ 15 7 ``` 返回它的最大深度 3 ......
LeetCode 40. 组合总和 II
``` class Solution { public: vector> res; vector> combinationSum2(vector& candidates, int target) { sort(candidates.begin(),candidates.end()); dfs(can ......
LeetCode 39. 组合总和
``` class Solution { public: vector> res; vector> combinationSum(vector& candidates, int target) { dfs(candidates,0,target); return res; } vector path ......
【leetcode】21. Merge Two Sorted Lists
将两个升序链表合并为一个新的 **升序** 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:**  **输入:**l1 = \[1,2,4\] ......
QA|重写了元素定位后报错xx object has no attribute 'find_element'|网页计算器自动化测试实战
代码如下: 1 # basepage.py 2 3 from selenium import webdriver 4 5 6 class BasePage(): 7 """ 8 基类 用作初始化 封装常用操作 9 """ 10 11 def __init__(self): 12 """ 13 初始化 ......
Leetcode 2611. 老鼠和奶酪
### 题目: 有两只老鼠和 `n` 块不同类型的奶酪,每块奶酪都只能被其中一只老鼠吃掉。 下标为 `i` 处的奶酪被吃掉的得分为: - 如果第一只老鼠吃掉,则得分为 `reward1[i]` 。 - 如果第二只老鼠吃掉,则得分为 `reward2[i]` 。 给你一个正整数数组 `reward1` ......
this.$refs['form'].resetFields()方法的注意问题
1、要想this.$refs[‘form’].resetFields()方法有效,必须配置el-form :model 属性和el-form-item中的prop属性,才可以 2、在还没有显示对话框之前就调用this.$refs[‘form’].resetFields(),会报错。 应使用此方式:t ......
US firm's official entry into segment to motivate more Chinese peers to join in
Apple Inc's augmented reality headset will help accelerate the development of the AR industrial chain in China, and push the product not only for ente ......
【Checkpoint】Command for log's checkpoint - SQLserver, Oracle, PostgreSQL
## 文档引子 最近,SQLserver环境中的SQL always on 因事务爆满 导致磁盘持续告警, 通过这次事件,记载下SQLserver AG的事务日志处理的正确方式,同时也把Oracle以及PG的相关的checkpoint问题一并做个简单的总结,并且只从结果的角度给出过程,至于具体的理论 ......
Failed to install package 'cv2'
#### 1.报错 无法导入import cv,这里多嘴一句,不是python下载连接问题,也不是外网下载问题,所以根本不是cv2包下载不下来,因为需要下载的根本不是cv包。  # 2 构建字典树 ```python class Trie: def __init__(self): # 字典树结构 # children 数 ......
rosetta error: 'StructureID' has not been declared
错误的原因为编译器版本太高,解决方法也很简单,到文件 src/protocols/features/FeaturesReporter.fwd.hh 的顶部加入下面这句: 1 #include <cstdint> ......
Leetcode刷题指南
## 1. 数据结构 ### 1.1 数组 - **循环数组问题**:把数组扩大为两倍即可,但不是真的扩大两倍,而是通过索引取模的方式 ### 1.2 链表 链表可以通过引入虚拟头节点 `ListNode *dummy = new ListNode{-1, nullptr}` 来极大简化 0. ** ......
leetcode 17. 电话号码的字母组合
## 递归 自己写了个递归的算法 ```java class Solution { public List letterCombinations(String digits) { List resList = recursion(digits); return resList; } public L ......
错误记录:创建mysql+springboot的demo报BeanCreationException: Error creating bean with name 'roleRepository' defined in xx.repository.RoleRepository defined in @EnableJpaRepositories declared on JpaConfigration
java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.lo ......
Leetcode 2352. 相等行列对
### 题目: 给你一个下标从 `0` 开始、大小为 `n x n` 的整数矩阵 `grid` ,返回满足 `R~i~` 行和 `C~j~` 列相等的行列对 `($$R_i$$, C~j~)` 的数目。 如果行和列以相同的顺序包含相同的元素(即相等的数组),则认为二者是相等的。 ### 难度:简单 ......
Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers
1)错误信息 Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service. at org.apac ......
Django修改数据库时出错 django.db.utils.OperationalError: (1091, "Can't DROP 'content'; check that column/key exists")
记录下简单的处理方法: 报错信息: django.db.utils.OperationalError: (1091, "Can't DROP 'content'; check that column/key exists") 可能数据库中的字段结构已经完成了此字段的修改但是在 python mana ......
leetcode 15. 三数之和
## 暴力法 暴力解法总是最直接能想到的解法。 ```java NA ``` ## 双指针法 贴一个评论区看到的解法 ```java class Solution { //定义三个指针,保证遍历数组中的每一个结果 //画图,解答 public List> threeSum(int[] nums) { ......
Leetcode Hot 100 & 49. Group Anagrams
写在前面: 不知不觉已经研二下了,既然选择以后走AI这条路,不可避免地也得刷一刷leetcode题目,因为招聘的时候笔试总是要用到的。首先刷一刷leetcode的hot 100题,好记性赶不上烂笔头,记录下来在写这些算法题中的收获给自己看。 参考资料: 考点:哈希 & [题干] 这题没做出来,第一次 ......
Cause: org.apache.ibatis.builder.BuilderException: Ambiguous collection type for property 'emps'. You must specify 'javaType' or 'resultMap'
Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error pa... ......
[LeetCode] 2352. Equal Row and Column Pairs
Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair is co ......
[LeetCode] 1347. Minimum Number of Steps to Make Two Strings Anagram 制造字母异位词的最小步骤数
You are given two strings of the same length `s` and `t`. In one step you can choose **any character** of `t` and replace it with **another character* ......
leetcode-图论总结
此文总结一下常见图论算法,代码可以为后续遇见类似题目提供参考: 1. 图的表示: 邻接矩阵:可通过创建数组得到 邻接表:我个人喜欢通过LinkedList<int[]>[] graph = new LinkedList[n];得到。 Edge List:同样可以通过LinkedList<int[]> ......
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
这个异常在springboot,是一个常见的异常,我们引入了mybatis依赖,确没有在.yml文件中配置数据源,这次我配置了数据源,但是因为有二个application.yml和application-dev.yml,没有指定yml的环境,在application.yml中添加指定dev即可 ......
Python中encoding='utf-8-sig'是什么意思
大家好,我是皮皮。 ### 一、前言 前几天在Python白银群【凡人不烦人】问了一个`Python`编码的问题,这里拿出来给大家分享下。 ![image.png](https://upload-images.jianshu.io/upload_images/26239789-4f0c6e4f9f5 ......
Let's Encrypt 证书申请
申请 Let's Encrypt 证书sudo apt install certbotsudo certbot certonly --webroot -w 网站根目录 -d 网站域名 生成 ssl_dhparamsudo openssl dhparam -out /etc/letsencrypt/s ......