leetcode anagrams string find

MySQL插入数据报错:1366 Incorrect string value: '\xF0\xA0\xB9\xB3\xF0\xA0...' for column xxxx

[10501]SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xF0\xA0\xB9\xB3\xF0\xA0...' for column xxxx at row 1 是因为MySQL不能识别4个字节的 ......
Incorrect xF0 xA0 数据 string

【DP】LeetCode 62. 不同路径

题目链接 62. 不同路径 思路 代码 class Solution { public int uniquePaths(int m, int n) { int[][] dp = new int[m][n]; Arrays.fill(dp[0], 1); for(int i = 0; i < m; i ......
路径 LeetCode 62

leetcode top100-01

最好能说明一下为什么不怕重复。看评论里有很多人提出这个问题,说hash冲突。 我在这里解答一下这个问题。 1.每次写入时,判断条件 不是当前的key本身存不存在,而是key和 tag 之间的差值存不存在,这一点很重要。 2.题目命题说明了一点,假定只有一个解。也就是说重复元素再多都无所谓。 case ......
leetcode 100 top 01

leetcode top100 - 02

坑 转换成数字进行运算,最后转换成链表。可能会出现溢出的情况。 因为无论是int还是long类型表达的数字长度是有限的,而链表的长度是可以无限追加的。 解释是干扰你的,其实就是依次从低位到高位的进位过程 笔试思路 把链表依次填充到数组中,数组容易操作,然后逐位进行加法运算; 面试思路 使用链表的思路 ......
leetcode 100 top 02

Leetcode19. 删除链表的倒数第 N 个结点

19. 删除链表的倒数第 N 个结点 自己纯手写第一题,递归有点冗杂,开辟了虚拟头节点,而且要特别注意边界条件(当倒数第n个正好是头节点时)。 ** * Definition for singly-linked list. * struct ListNode { * int val; * ListN ......
结点 Leetcode 19

Find 3-friendly Integers (牛客多校) (取模的优化->处理整除问题)

数据范围 L-R<=1e18 思路: 稍微一想就可以知道, 3-friendly 的数其实很多的 然后这些想想这这些情况, 被3整除利用 各个位数相加可以被3整除 然后利用 取模 优化, 1 2 ,发现: 1 1 , 2 2 ,1 ,2 是不可以的 111 ,222 ,12 , 21 都是可以的, ......
friendly Integers 问题 Find gt

find

用于在指定目录下查找文件和目录 实例注释 find /etc -name ".txt" -ls 查找文件以列表的形式查看 find /etc -iname ".txt" 忽略大小写 find /etc -size +5M(-5 5) 查找大于5M的文件 find /etc -mtime +5(-5 ......
find

代码随想录Day16-Leetcode104. 二叉树的最大深度,111.二叉树的最小深度 ,222.完全二叉树的节点个数

104. 二叉树的最大深度 首先是层序遍历 /** * Definition for a binary tree node. * function TreeNode(val, left, right) { * this.val = (val undefined ? 0 : val) * this.l ......
深度 随想录 节点 随想 个数

LeetCode 287. 寻找重复数

LeetCode 287. 寻找重复数 题目 \287. 寻找重复数 中等 2.1K 相关企业 给定一个包含 n + 1 个整数的数组 nums ,其数字都在 [1, n] 范围内(包括 1 和 n),可知至少存在一个重复的整数。 假设 nums 只有 一个重复的整数 ,返回 这个重复的数 。 你设 ......
LeetCode 287

String ends with?

Instructions Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string). Solutio ......
String ends with

代码随想录Day15-Leetcode102. 二叉树的层序遍历,226.翻转二叉树,101. 对称二叉树

102. 二叉树的层序遍历 题目链接:https://leetcode.cn/problems/binary-tree-level-order-traversal/ bfs,队列,记录下本层的数量和下一层的数量 /** * Definition for a binary tree node. * f ......
随想录 随想 Leetcode 代码 Day

【DP】LeetCode 剑指 Offer 60. n个骰子的点数

题目链接 剑指 Offer 60. n个骰子的点数 思路 动态规划问题中,只用考虑第 n 个阶段如何由第 n-1 个阶段转化过来 在本题中,就是投掷 n 个骰子的结果如何由 投掷 n-1 个骰子的结果转化过来。 代码 class Solution { public double[] dicesPro ......
骰子 点数 LeetCode Offer 60

《c++徒步》string篇-string类应用

C++中的string类用法简介 原文链接:https://blog.csdn.net/liitdar/article/details/80498634 概述 string是C++标准库的一个重要的部分,主要用于字符串处理。 c_str(),string转换为char* // 方法一:使用 c_st ......
string

《c++徒步》string篇-string.h应用

string.h中的常见方法 strcat(),是在字符串后面追加上另外一个字符串 声明: #include <string.h> char *strcat(char *dest, const char *src); 解释: dest – 指向目标数组,该数组包含了一个 C 字符串,且足够容纳追加后 ......
string

《c++越野》数据篇-string

string.h和string的区别 <string>:是包装了std 的C++头文件,对应的是新的string 类,string s1就是建立一个string类的对象 <string.h>:是旧的C 头文件,对应的是基于char*的字符串处理函数,的c语言的东西 并无类,所以不能 string s ......
数据 string

[Typescript] Use never for readable string

const demoFunc = <TObj extends {}>(obj: TObj, key: ErrorIfNever<keyof TObj, `You much pass at least one key`>) => { return obj[key as keyof TObj] } ty ......
Typescript readable string never Use

leetcode-1089-easy

Duplicate Zeros Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that ele ......
leetcode 1089 easy

leetcode-1009-easy

Complement of Base 10 Integer The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binar ......
leetcode 1009 easy

leetcode-1317-easy

Convert Integer to the Sum of Two No-Zero Integers No-Zero integer is a positive integer that does not contain any 0 in its decimal representation. Gi ......
leetcode 1317 easy

【LeetCode】35.搜索插入位置

题目描述 解法 思路:二分查找 class Solution { public: int searchInsert(vector<int>& nums, int target) { int left = 0, right = nums.size() - 1; int count = 0; if(nu ......
LeetCode 位置 35

【LeetCode】278.第一个错误的版本

题目描述 解法 思路:二分查找 注意:当第一个 isBadVersion(mid)的结果为true时,得到第一个错误的版本 // The API isBadVersion is defined for you. // bool isBadVersion(int version); class Sol ......
LeetCode 错误 版本 278

idea子项目打jar包错误 Could not find artifact xxx:pom:1.0-SNAPSHOT 解决办法

idea子项目打jar包错误 Could not find artifact xxx:pom:1.0-SNAPSHOT 解决办法 原文链接:https://blog.csdn.net/a459471027/article/details/124195296 项目结构如下: 首先打开maven管理界面 ......
子项目 子项 artifact SNAPSHOT 错误

【LeetCode】704.二分查找

题目描述 解法 class Solution { public: int search(vector<int>& nums, int target) { int left = 0; int right = nums.size()-1; while(left <= right){ int mid = ......
LeetCode 704

D. Binary String Sorting

Problem - D - Codeforces 枚举/线性dp 枚举做法: 枚举每个点,满足条件左边全是0右边全是1 取每个点花费中的最小值 #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll co ......
Sorting Binary String

Mysql中find_in_set()函数与in()函数的用法

1.认识find_in_set()函数 Mysql官方文档手册,如下图: 2.find_in_set()基本操作 select find_in_set (‘b’, ‘a,b,c,d,w’); 结果为2,因为b字符串在strlist集合中,在第二个位置,起始数是从1开始的 select find_in ......
函数 find_in_set Mysql find set

leetcode 176

leetcode 176 第二高的薪水,查第二高的人的信息 1、使用ifnull(exp1, exp2)函数,limit offset子句 select ifnull( (select distinct salary from Employee order by salary desc limit ......
leetcode 176

Golang 挑战:编写函数 walk(x interface{}, fn func(string)),参数为结构体 x,并对 x 中的所有字符串字段调用 fn 函数。难度级别:递归。

golang 挑战:编写函数 walk(x interface{}, fn func(string)),参数为结构体 x,并对 x 中的所有字符串字段调用 fn 函数。难度级别:递归。 为此,我们需要使用 反射。 计算中的反射提供了程序检查自身结构体的能力,特别是通过类型,这是元编程的一种形式。这也 ......
函数 字段 字符串 interface 字符

代码随想录Day14-Leetcode144. 二叉树的前序遍历,94.二叉树的中序遍历,145.二叉树的后序遍历

递归遍历 前序遍历:根左右 一路俯冲,然后回头 /** * Definition for a binary tree node. * function TreeNode(val, left, right) { * this.val = (val undefined ? 0 : val) * this ......
随想录 随想 Leetcode 代码 Day

公共模块 Unable to find main class 问题

公共模块 Unable to find main class 解决方法在公共模块中的pom文件加入如下配置 <build> <plugins> <plugin> <!-- 公共模块 Unable to find main class--> <groupId>org.springframework.b ......
模块 Unable 问题 class find

TS里 ?string 和 string?

在 TypeScript 中,? 符号用于表示可选属性或可选参数。当 ? 符号放在类型的前面时,表示该类型为可选类型。当 ? 符号放在变量或参数的后面时,表示该变量或参数是可选的,可以不传值。因此,?string 和 string? 表示的含义是不同的。?string 表示一个可选的字符串类型,即这 ......
string