leetcode anagrams string find

LeetCode----二维网格DFS

# 1 算法模板 ``` void dfs(int[][] grid, int r, int c) { // 判断 base case // 如果坐标 (r, c) 超出了网格范围,直接返回 if (!inArea(grid, r, c)) { return; } // 访问上、下、左、右四个相邻结 ......
网格 LeetCode DFS

[ERROR] Can't find error-message file '/data/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.

1. MySQL5.7.21启动时报错: [ERROR] Can't find error-message file '/data/mysql/3307/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir ......
error-message message 39 error file

windows 10 wsl 环境 docker 无法正常启动 -The system cannot find the file specified

错误信息: error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Get "ht ......
specified windows 环境 docker cannot

在List<String>中找出重复的字符串元素__简单高效

点击查看代码 ``` public void assertNoDuplicateStr(List list, String key) { if (ObjectUtils.isEmpty(list)) { return; } Set set = new HashSet(); list.stream() ......
字符串 字符 元素 String List

用yum安装软件提示 cannot find a valid baseurl for repo:base/7/x86_64 的解决方法

转自:https://www.jianshu.com/p/50f0fb206cf7 出现这个问题是因为yum在安装包的过程中,虽然已经联网,但是没法解析远程包管理库对应的域名,所以我们只需要在网络配置中添加上DNS对应的ip地址即可。 1、操作 vi /etc/sysconfig/network-s ......
baseurl 方法 cannot valid 软件

Re: finding all cycles in a graph

ref: https://cs.stackexchange.com/questions/7216/find-the-simple-cycles-in-a-directed-graph Re: finding all cycles in a graph From: Juan Pablo Carbaja ......
finding cycles graph all Re

[LeetCode] 1351. Count Negative Numbers in a Sorted Matrix

Given a m x n matrix grid which is sorted in non-increasing order both row-wise and column-wise, return the number of negative numbers in grid. Exampl ......
LeetCode Negative Numbers Matrix Sorted

递归-二叉搜索树-leetcode98验证二叉搜索树

```java //leetcode submit region begin(Prohibit modification and deletion) /** * Definition for a binary tree node. * public class TreeNode { * int va ......
leetcode 98

LeetCode35.搜索插入位置

//个人学习笔记用 - 题目: 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。 请必须使用时间复杂度为 O(log n) 的算法。 参考题解--代码随想录 - 暴力解法: ~~~c++ class Solution { pub ......
LeetCode 位置 35

kanzi的安卓工程报错解决办法:Error: Could not find or access Kanzi's Gradle plugin directory

这是因为安卓里配置的环境变量不对。 需要检查下述文件的路径是否真实存在,以及和使用的版本是否匹配 ......
directory 办法 access Gradle plugin

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 90 II

【leetcode】104. Maximum Depth of Binary Tree

给定一个二叉树,找出其最大深度。 二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 **说明:** 叶子节点是指没有子节点的节点。 **示例:** 给定二叉树 `[3,9,20,null,null,15,7]`, ``` 3 / \ 9 20 / \ 15 7 ``` 返回它的最大深度 3 ......
leetcode Maximum Binary Depth Tree

LeetCode 40. 组合总和 II

``` class Solution { public: vector> res; vector> combinationSum2(vector& candidates, int target) { sort(candidates.begin(),candidates.end()); dfs(can ......
总和 LeetCode 40 II

LeetCode 39. 组合总和

``` class Solution { public: vector> res; vector> combinationSum(vector& candidates, int target) { dfs(candidates,0,target); return res; } vector path ......
总和 LeetCode 39

【leetcode】21. Merge Two Sorted Lists

将两个升序链表合并为一个新的 **升序** 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:** ![](https://assets.leetcode.com/uploads/2020/10/03/merge_ex1.jpg) **输入:**l1 = \[1,2,4\] ......
leetcode Sorted Merge Lists Two

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` ......
奶酪 Leetcode 老鼠 2611

C++ 将unsigned char数组 转化为 string 存储

工作的时候遇到一个问题,需要把一个存储二进制网络流的buff转化为一个字符串进行存储。在网上搜了半天看到的方法都比较复杂。在这里介绍一种自己认为比较简便的方法。 二进制网络流一般都是unsigned char类型。跟char的区别在于读取的方式不同,但是存储的位数并没有什么不同。假设unsigned ......
数组 unsigned string char

string 总结

都说了不要走了,String函数总结 string的函数,真香。(不总结迭代器的) (15条消息) c++中的string常用函数用法总结_fdqw_sph的博客-CSDN博客 C++string中用于查找的find系列函数浅析 - 同勉共进 - 博客园 (cnblogs.com) C++中stri ......
string

CF149E Martian Strings 题解

#### 题意 给定一个主串 $s$ 和一些模式串 $p_i$,问主串中是否存在两个不相交的非空字串,拼起来和模式串相同。 考虑如何拼接 $p_i$。我们可以从前向后匹配一遍主串,找到 $p_i$ 的所有长度的前缀在主串中最先出现的位置,并记录下来;然后再从后向前跑匹配,每次匹配上一个后缀,就判断该 ......
题解 Martian Strings 149E 149

LeetCode----字典树

# 1 原理 [字典树原理参考](https://blog.csdn.net/m0_46202073/article/details/107253959) # 2 构建字典树 ```python class Trie: def __init__(self): # 字典树结构 # children 数 ......
字典 LeetCode

Leetcode刷题指南

## 1. 数据结构 ### 1.1 数组 - **循环数组问题**:把数组扩大为两倍即可,但不是真的扩大两倍,而是通过索引取模的方式 ### 1.2 链表 链表可以通过引入虚拟头节点 `ListNode *dummy = new ListNode{-1, nullptr}` 来极大简化 0. ** ......
Leetcode 指南

leetcode 17. 电话号码的字母组合

## 递归 自己写了个递归的算法 ```java class Solution { public List letterCombinations(String digits) { List resList = recursion(digits); return resList; } public L ......
电话号码 字母 leetcode 号码 电话

Clob数据类型转换成为String

import java.sql.Clob; public String ClobToString(Clob clob) throws SQLException, IOException { String reString = ""; Reader is = clob.getCharacterStre ......
类型 数据 String Clob

Leetcode 2352. 相等行列对

### 题目: 给你一个下标从 `0` 开始、大小为 `n x n` 的整数矩阵 `grid` ,返回满足 `R~i~` 行和 `C~j~` 列相等的行列对 `($$R_i$$, C~j~)` 的数目。 如果行和列以相同的顺序包含相同的元素(即相等的数组),则认为二者是相等的。 ### 难度:简单 ......
行列 Leetcode 2352

7.1 String类对象实例化

``` public class HelloWorld { public static void main(String[] args){ //String str = "www.mldn.cn";// 直接赋值-String类对象实例化 String str = new String("www.b ......
实例 对象 String 7.1

C++ 中的 String 类

C++ 标准库提供了 string 类类型,支持上述所有的操作,另外还增加了其他更多的功能。我们将学习 C++ 标准库中的这个类,现在让我们先来看看下面这个实例: 现在您可能还无法透彻地理解这个实例,因为到目前为止我们还没有讨论类和对象。所以现在您可以只是粗略地看下这个实例,等理解了面向对象的概念之 ......
String

Leetcode Hot 100 & 49. Group Anagrams

写在前面: 不知不觉已经研二下了,既然选择以后走AI这条路,不可避免地也得刷一刷leetcode题目,因为招聘的时候笔试总是要用到的。首先刷一刷leetcode的hot 100题,好记性赶不上烂笔头,记录下来在写这些算法题中的收获给自己看。 参考资料: 考点:哈希 & [题干] 这题没做出来,第一次 ......
Leetcode Anagrams Group Hot 100

leetcode 15. 三数之和

## 暴力法 暴力解法总是最直接能想到的解法。 ```java NA ``` ## 双指针法 贴一个评论区看到的解法 ```java class Solution { //定义三个指针,保证遍历数组中的每一个结果 //画图,解答 public List> threeSum(int[] nums) { ......
之和 leetcode 15

AtCoder Beginner Contest 225 F String Cards

[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc225_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc225/tasks/abc225_f "AtCoder 传送门") 这题是真的强。。 ......
Beginner AtCoder Contest String Cards