leetcode anagrams string find

7-009-(LeetCode- 309) 最佳买卖股票时机含冷冻期

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
时机 LeetCode 股票 009 309

7-003-(LeetCode- 62) 不同路径

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
路径 LeetCode 003 62

7-004-(LeetCode- 64) 最小路径和

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
路径 LeetCode 004 64

7-002-(LeetCode- 5) 最长回文子串

1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
回文 LeetCode 002

python中find用法

find() 方法常用于在字符串中查找子字符串的位置,它可以帮助我们判断一个字符串中是否包含某个子字符串,以及这个子字符串在字符串中的位置。 find() 方法的应用场景比较多,下面列举几个常见的使用场景: 查找子字符串:可以使用 find() 方法查找一个字符串中是否包含某个子字符串,并获取该子字 ......
python find

LeetCode/移动石子直到连续

###1. 移动石子直到连续(三个石子) class Solution { public: vector<int> numMovesStones(int a, int b, int c) { int x = min({a, b, c}); int z = max({a, b, c}); int y ......
石子 LeetCode

[ERR] collect2: fatal error: cannot find 'ld'

今天在orin nano上希望g++使用lld代替ld时候,在如下命令时候抛出了如标题的错误 >> g++ -fuse-ld=lld a.cc collect2: fatal error: cannot find 'ld' compilation terminated. 因为最开始配置llvm-15 ......
collect2 collect cannot fatal error

find命令

常用的find命令 find /path/to/dir -type f -name "*.txt" -print0 | xargs -0 ls -ltrh #速度快 find /path/to/dir -type f -name "*.txt" -exec ls -ltrh {} \; #速度慢 这 ......
命令 find

[LeetCode] 1033. Moving Stones Until Consecutive

There are three stones in different positions on the X-axis. You are given three integers a, b, and c, the positions of the stones. In one move, you p ......
Consecutive LeetCode Moving Stones Until

fatal: couldn't find remote ref master问题的解决

问题描述 在写入决定合并并不相关的分支的代码之后,就又出现了这个报错,就很离谱,麻了呀家人们! 问题解决 git pull origin master --allow-unrelated-histories,这个命令执行错误,是因为,我这里的分支名称不叫作master,叫做main 旧版默认为mas ......
couldn remote master 问题 fatal

leetcode_D10_136只出现一次的数字

1.题目 2.解一 leetcode官方解法,主要用到了两个知识:第一个是reduce函数,需要注意的是在python3中,需要 通过“ from functools import reduce ”从模块中调用该函数;第二个知识是位运算中的异或运算,主要有以下计算法则。 有了这两个补充知识,该题目就 ......
leetcode_D leetcode 数字 136 10

4-28打卡c++ string容器

1 #include<iostream> 2 #include<string> 3 using namespace std; 4 //assign 5 void test01() 6 { 7 string str1; 8 //截取三个字符 9 str1.assign("hello,world", 3 ......
容器 string 28

C++ 中 string自带的find()详解

首先find()函数存在于string对象中,对于任何一个string类对象都自带find函数,这意味着我们可以对find函数进行重载。 find()一共可传七个参数,但是常用的的只有四种情况: 对于C++98来说: string(1) 传入两个参数,一个是对另一string对象的常引用,一是开始查 ......
string find

2023-04-28 LeetCode精选题目20道附我的Java实现

LeetCode精选题目20道 1.56.合并区间 贪心 给出一个区间的集合,请合并所有重叠的区间。 示例 1: 输入: intervals = [[1,3],[2,6],[8,10],[15,18]] 输出: [[1,6],[8,10],[15,18]] 解释: 区间 [1,3] 和 [2,6] ......
LeetCode 题目 2023 Java 04

C语言刷leetcode——并查集

概述 https://leetcode.cn/problems/number-of-provinces/solution/python-duo-tu-xiang-jie-bing-cha-ji-by-m-vjdr/ 基本概念 并查集是一种数据结构 并查集这三个字,一个字代表一个意思。 并(Union ......
leetcode 语言

类型转换: list string

/* 一: str -> list 二: list -> str 1 list元素全为str 2 list元素不全为str */ 一: str -> list if __name__ == '__main__': str1 = "12345" print(list(str1)) # ['1', '2 ......
类型 string list

vscode-leetcode

vscode 里写 leetcode 需要的插件xavier-cai.vscode-leetcode-cpp-debug, leetcode.vscode-leetcode LeetCode C++ Debugger.Delete Temporary Contents置为false ctrl+shi ......
vscode-leetcode leetcode vscode

string_agg聚合函数

string_agg()是一个聚合函数,把一个个字符串用指定的数据进行分隔 -- 请按照城市进行汇总,每个城市只有一行记录,记录内容为将每个城市中的所有当地客户的lastname用逗号连接 --string_agg是一个聚合函数 select a.City, string_agg(c.LastNam ......
string_agg 函数 string agg

LeetCode 241 为运算表达式设计优先级

LeetCode | 241.为运算表达式设计优先级 给你一个由数字和运算符组成的字符串 expression ,按不同优先级组合数字和运算符,计算并返回所有可能组合的结果。你可以 按任意顺序 返回答案。 生成的测试用例满足其对应输出值符合 32 位整数范围,不同结果的数量不超过 104 。 示例 ......
优先级 表达式 LeetCode 241

【二分查找】LeetCode 153. 寻找旋转排序数组中的最小值

题目链接 153. 寻找旋转排序数组中的最小值 思路 首先分析一下旋转数组可能有的状态: 左 < 中 < 右,此时最小值肯定在左边,应当收缩右边界 左 < 中,中 > 右,此时最小值肯定在右半段,应当收缩左边界 左 > 中,中 < 右,此时最小值肯定在左半段,应当收缩右边界 分析这三种状态可以发现, ......
数组 LeetCode 153

[LeetCode] 1031. Maximum Sum of Two Non-Overlapping Subarrays

Given an integer array nums and two integers firstLen and secondLen, return the maximum sum of elements in two non-overlapping subarrays with lengths  ......

LeetCode 双指针

15. 三数之和 (为0) 下标不能是重复的,必定右 i<l<r 1、先对数组排序(从小到大) 2、外层 i 遍历 如果 nums[i] > 0 ,整个 nums[] 后面的必定无法有三元组为0(排过序了,后面的 nums[l] nums[r] 都会大于0)。break。 如果 nums[i] = ......
指针 LeetCode

【LeetCode动态规划#14】子序列系列题(最长递增子序列、最长连续递增序列、最长重复子数组、最长公共子序列)

最长递增子序列 力扣题目链接(opens new window) 给你一个整数数组 nums ,找到其中最长严格递增子序列的长度。 子序列是由数组派生而来的序列,删除(或不删除)数组中的元素而不改变其余元素的顺序。例如,[3,6,2,7] 是数组 [0,3,1,6,2,2,7] 的子序列。 示例 1 ......
序列 数组 LeetCode 动态 14

【哈希表】LeetCode 895. 最大频率栈

题目链接 895. 最大频率栈 思路 很容易想到使用 map:valToFreq 来记录每个值出现的频率,这是没问题的,但关键是如何通过频率寻找到应该返回的数。 这时候我想到再加一个 map:freqToVal 来记录每个频率中出现的数字,为了符合题目返回最接近栈顶的元素的要求,freqToVal ......
频率 LeetCode 895

代码随想录Day38-Leetcode509. 斐波那契数,70. 爬楼梯,746. 使用最小花费爬楼梯

咳咳, 因为找实习+摆导致时间被浪费大半; 先从动态规划学起吧,之前的慢慢补。 理论基础 动态规划的解题步骤 1.确定dp数组及对应下标的含义 2.确定dp的状态转移方程(递推公式) 3.确定dp数组如何初始化 4.确定dp遍历顺序 5.距离推导dp数组验证 509. 斐波那契数 题目链接:http ......
楼梯 随想录 随想 Leetcode 代码

Redis - string类型

Redis的key是String类型的,如果Value如果也是String类型,相当于把两个字符串映射起来,即key-value。这里字符串不仅仅是传统意义上的字符串,例如“hello world”,也可以是JSON、HTML等。 1、string 字符串 //string key := "go2k ......
类型 string Redis

MissingServletRequestParameterException: Required request parameter 'xxx' for method parameter type String is not present异常处理

关于简单参数传递的一个异常 先前情提要一下,在练习一个带分页的员工查询请求功能,接口文档描述如下 其中页码跟记录数是必须参数,然后有个按姓名模糊查询,这个参数是可有可无的 然后我最初写的代码长这样 用@RequestParam注解来获取这个url中携带的简单参数 然后测试页面的时候数据出不来,ide ......

Redis - 存储对象信息是用 Hash 还是 String

日常工作中存储对象信息时,一般有两种做法,一种是用 String存储,另一种是Hash 存储。既然两种数据结构都可以存储结构体信息。到底哪种更加合适呢? String 和 Hash 占用内存的比较 首先用代码先插入 10000 条数据,然后用可视化工具来看看内存的占用情况。 const Redis ......
对象 还是 String Redis 信息

【TreeMap】LeetCode 1438. 绝对差不超过限制的最长连续子数组

题目链接 1438. 绝对差不超过限制的最长连续子数组 思路 本题一看就是一个要用到滑动窗口的题目,难点在于如何快速求窗口中的最大值和最小值。幸好 Java 中有 TreeMap 这个数据结构,它在构成 map 映射的同时,还能够保证其中的元素有序,这样就能很方便求得窗口中的最大值和最小值了。 代码 ......
数组 LeetCode TreeMap 1438

leetcode 608 樹節點

樹節點 select id, 'Root' as Type from tree where p_id is null union select id, 'Inner' as Type from tree where id in ( select distinct p_id from tree whe ......
leetcode 608