leetcode column equal pairs

【LeetCode动态规划#15】最长公共子序列II

### 最长公共子序列(二) #### 描述 给定两个字符串str1和str2,输出两个字符串的最长公共子序列。如果最长公共子序列为空,则返回"-1"。目前给出的数据,仅仅会存在一个最长的公共子序列 数据范围:0≤∣���1∣,∣���2∣≤20000≤∣*s**t**r*1∣,∣*s**t**r* ......
序列 LeetCode 动态 15

【LeetCode1】统计参与通信的服务器

# 【题目】 - 这里有一幅服务器分布图,服务器的位置标识在 `m * n` 的整数矩阵网格 `grid` 中,1 表示单元格上有服务器,0 表示没有。 - 如果两台服务器位于同一行或者同一列,我们就认为它们之间可以进行通信。 - 请你统计并返回能够与至少一台其他服务器进行通信的服务器的数量。 # ......
LeetCode1 LeetCode 服务器

[LeetCode][152]maximum-product-subarray

# Content Given an integer array nums, find a subarray that has the largest product, and return the product. The test cases are generated so that the ......

[LeetCode][139]word-break

# Content Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dict ......
word-break LeetCode break word 139

Leetcode——1957、删除字符使字符串变好

一个字符串如果没有 三个连续 相同字符,那么它就是一个 好字符串 。 给你一个字符串 s ,请你从 s 删除 最少 的字符,使它变成一个 好字符串 。 请你返回删除后的字符串。题目数据保证答案总是 唯一的 。 示例 1: 输入:s = "leeetcode" 输出:"leetcode" 解释: 从第 ......
字符 字符串 Leetcode 1957

[LeetCode][124]binary-tree-maximum-path-sum

# Content A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can onl ......

mysql导入sql文件“Index column size too large. The maximum column size is 767 bytes.”

问题分析 由于 MySQL 的 InnoDB 引擎表索引字段长度的限制为 767 字节,因此对于多字节字符集的大字段或者多字段组合,创建索引时会出现该问题。 说明 注:以 utf8mb4 字符集字符串类型字段为例。utf8mb4 是 4 字节字符集,默认支持的索引字段最大长度是 191 字符(767 ......
column size maximum 文件 mysql

Leetcode 1. 两数之和(Two sum)

[题目链接🔗](https://leetcode.cn/problems/two-sum) 给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素 ......
之和 Leetcode Two sum

elasticsearch from + size must be less than or equal to: [10000] but was [100000]

说明:当分页查询时,默认最大总数是10000(from+size<=10000),当我现在业务需要查询最大100000条时,就报错了。 方案1:可以为某个es放开到指定的返回总数,也可以对整个es的索引做设置。但这样对内存消耗很大, 可能导致内存溢出,elasticsearch重启又会恢复默认100 ......
elasticsearch 100000 10000 equal from

[LeetCode] 1267. Count Servers that Communicate

You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that ......
Communicate LeetCode Servers Count 1267

Leetcode 1782. 统计点对的数目

这两天实训比较忙,之后补 TRANSLATE with x English Arabic Hebrew Polish Bulgarian Hindi Portuguese Catalan Hmong Daw Romanian Chinese Simplified Hungarian Russian ......
数目 Leetcode 1782

leetcode 12

![image](https://img2023.cnblogs.com/blog/3254178/202308/3254178-20230823182631200-1538353557.png) ### 算法介绍: - **哈希** - **贪心** - 实现代码如下 ```cpp class S ......
leetcode 12

Leetcode605——种花问题

假设有一个很长的花坛,一部分地块种植了花,另一部分却没有。可是,花不能种植在相邻的地块上,它们会争夺水源,两者都会死去。 给你一个整数数组 flowerbed 表示花坛,由若干 0 和 1 组成,其中 0 表示没种植花,1 表示种植了花。另有一个数 n ,能否在不打破种植规则的情况下种入 n 朵花? ......
Leetcode 问题 605

Leetcode 202. 快乐数(Happy number)

[题目链接🔗](https://leetcode.cn/problems/happy-number) 编写一个算法来判断一个数 n 是不是快乐数。 「快乐数」 定义为: 对于一个正整数,每一次将该数替换为它每个位置上的数字的平方和。 然后重复这个过程直到这个数变为 1,也可能是 无限循环 但始终变 ......
Leetcode number Happy 202

[LeetCode][121]best-time-to-buy-and-sell-stock

# Content You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing a s ......

[LeetCode][96]unique-binary-search-trees

# Content Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 t ......

LeetCode 算法题解之 26 进制转换 All In One

LeetCode 算法题解之 26 进制转换 All In One 171. Excel Sheet Column Number 171. Excel 工作表列号 168. Excel Sheet Column Title 168. Excel 工作表列头 ......
题解 进制 算法 LeetCode All

Leetcode 459——重复的子字符串

给定一个非空的字符串 s ,检查是否可以通过由它的一个子串重复多次构成。 示例 1: 输入: s = "abab" 输出: true 解释: 可由子串 "ab" 重复两次构成。 示例 2: 输入: s = "aba" 输出: false 示例 3: 输入: s = "abcabcabcabc" 输出 ......
字符串 字符 Leetcode 459

[LeetCode][72]edit-distance

# Content Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three ......
edit-distance LeetCode distance edit 72

[LeetCode][85]maximal-rectangle

# Content Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example 1: In ......

Leetcode 349.两个数组的交集(Intersection of two arrays)

[题目链接🔗](https://leetcode.cn/problems/intersection-of-two-arrays) 给定两个数组 nums1和 nums2 ,返回 它们的交集 。输出结果中的每个元素一定是 唯一 的。我们可以 不考虑输出结果的顺序 。 示例 1: ``` 输入:num ......
数组 交集 Intersection Leetcode 两个

Leetcode 849. 到最近的人的最大距离

# 题目描述 给你一个数组 seats 表示一排座位,其中 seats[i] = 1 代表有人坐在第 i 个座位上,seats[i] = 0 代表座位 i 上是空的(下标从 0 开始)。 至少有一个空座位,且至少有一人已经坐在座位上。 亚历克斯希望坐在一个能够使他与离他最近的人之间的距离达到最大化的 ......
Leetcode 849

Leetcode 两个队列实现栈 swift

queue1 是最后生成的栈 queue2 是临时队列,把新进来的先放进去,再把queue1里的数据从头到尾读进去,然后互换 class MyStack { var queue1: [Int] = [] var queue2: [Int] = [] init() { } func push(_ x: ......
队列 Leetcode 两个 swift

[LeetCode] 2337. Move Pieces to Obtain a String

You are given two strings start and target, both of length n. Each string consists only of the characters 'L', 'R', and '_' where: The characters 'L'  ......
LeetCode Pieces Obtain String 2337

第 111 场双周赛 - 力扣(LeetCode)

# [第 111 场双周赛 - 力扣(LeetCode)](https://leetcode.cn/contest/biweekly-contest-111/) ## [2824. 统计和小于目标的下标对数目 - 力扣(LeetCode)](https://leetcode.cn/problems/ ......
LeetCode 111

[Leetcode Weekly Contest]359

链接:[LeetCode](https://leetcode-cn.com/contest/weekly-contest-359/) ## [Leetcode]2828. 判别首字母缩略词 给你一个字符串数组 words 和一个字符串 s ,请你判断 s 是不是 words 的 首字母缩略词 。 如 ......
Leetcode Contest Weekly 359

为什么使用HashMap的键存的是自定义的键时需要重写hashcode和equals方法?

当hashMap的键存的是自定义的键时需要重写对象的hashcode和equals方法 存入的是对象时,应该hashMapd的键不能存储的值不能相同,如果重写方法的hashcode()方法,他会默认调用object类的hashcode方法,但是 object的hashcode方法时地址值计算出来的h ......
hashcode HashMap 方法 equals

LeetCode day 1

class Solution { public: vector<int> sortArrayByParityII(vector<int>& nums) { int n = nums.size(); vector<int> even; // 存储偶数 vector<int> odd; // 存储奇数 ......
LeetCode day

leetcode

# 最长回文子串 class Solution: def longestPalindrome(self, s: str) -> str: return self.manacher(s) @staticmethod def manacher(s: str) -> str: # 如果s是单字符的字符串, ......
leetcode

Leetcode 59. 螺旋矩阵 II && 剑指 Offer 29. 顺时针打印矩阵

这两个题非常相似,但是前者较为简单,后者较难。 由于前者访问的矩阵是方阵,因此可以通过迭代去做(因为方阵每次迭代,长和宽缩水的大小是一样的,但是矩阵不可以,因为矩阵最后一次迭代,长和宽的缩水不一定一样) class Solution { public: vector<vector<int>> gen ......
矩阵 时针 螺旋 amp Leetcode