leetcode column equal pairs

toString 和equals方法

......
toString 方法 equals

[LeetCode] 51. N-Queens

The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return al ......
LeetCode N-Queens Queens 51

二刷Leetcode-Days08

数组: /** * 209. 长度最小的子数组 * * @param target 正整数 * @param nums 含有 n 个正整数的数组 * @return 找出该数组中满足其和 ≥ target 的长度最小的 连续子数组,并返回其长度。如果不存在符合条件的子数组,返回 0 。 */ pub ......
Leetcode-Days Leetcode Days 08

用自然语言让AI打leetcode周赛

还在自己吭哧吭哧打算法平台Leetcode的周赛?为什么不试试神奇的ChatGPT类AI呢! 用AI助手Claude参加第103场周赛,共四道题,均完成了AC,能达到参与者前10%的成绩。 事情的起因是知乎上一位叫萧雅的用户尝试使用AI进行编程,但在测试过程中,她发现直接给出题目让AI进行编程并输出 ......
自然语言 leetcode 自然 语言

CF1585F. Non-equal Neighbours

三倍经验:[CF1591F. Non-equal Neighbours](https://codeforces.com/problemset/problem/1591/F),[ARC115E - LEQ and NEQ](https://atcoder.jp/contests/arc115/task ......
Neighbours Non-equal equal 1585 Non

LeetCode 530. 二叉搜索树的最小绝对差

#题目链接:[LeetCode 530. 二叉搜索树的最小绝对差](https://leetcode.cn/problems/minimum-absolute-difference-in-bst/) ##题意: 给你一个二叉搜索树的根节点 root ,返回 树中任意两不同节点值之间的最小差值 。 差 ......
LeetCode 530

LeetCode 98. 验证二叉搜索树

#题目链接:[LeetCode 98. 验证二叉搜索树](https://leetcode.cn/problems/validate-binary-search-tree/) ##题意: 给你一个二叉树的根节点 root ,判断其是否是一个有效的二叉搜索树。 有效 二叉搜索树定义如下: * 节点的左 ......
LeetCode 98

推断题(D - The BOSS Can Count Pairs)

D - The BOSS Can Count Pairs #include<bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" //数学题关注边界条件和推断其他的值枚举算答案 //nlogn做法 // ......
Count Pairs BOSS The Can

LeetCode 700. 二叉搜索树中的搜索

#题目链接:[LeetCode 700. 二叉搜索树中的搜索](https://leetcode.cn/problems/search-in-a-binary-search-tree/) ##题意: 给定二叉搜索树(BST)的根节点 root 和一个整数值 val。 你需要在 BST 中找到节点值等 ......
LeetCode 700

leetcode1657vector的初始化和比较

满足相似的条件:1.长度一样 2.组成的字母组合相同 3.每个组成字母的个数集合相同 比较两个vector,直接用==/!= 排序vector sort(迭代器1,迭代器2); 初始化vector形式:vector<类型>name(形式) if(word1.lenth()!=word2.length ......
leetcode vector 1657

LeetCode 617. 合并二叉树

#题目链接:[LeetCode 617. 合并二叉树](https://leetcode.cn/problems/merge-two-binary-trees/) ##题意: 给你两棵二叉树: root1 和 root2 。 想象一下,当你将其中一棵覆盖到另一棵之上时,两棵树上的一些节点将会重叠(而 ......
LeetCode 617

LeetCode 654. 最大二叉树

###题目链接:[LeetCode 654. 最大二叉树](https://leetcode.cn/problems/maximum-binary-tree/) ###题意: 给定一个不重复的整数数组 nums 。 最大二叉树 可以用下面的算法从 nums 递归地构建: * 创建一个根节点,其值为  ......
LeetCode 654

Java中==和equals的区别

**1、==是一个比较运算符** 1. 即可以判断基本数据类型,又可以判断引用数据类型 2. 如果判断基本数据类型,判断的是值是否相等。示例:int i = 10;double d = 10.0 3. 如果判断引用数据类型,判断的是地址是否相等,即判定是不是同一个对象 **2、equals是Obje ......
equals Java

【LeetCode双向链表】LRU详解,双向链表实战

### LRU缓存 请你设计并实现一个满足 LRU (最近最少使用) 缓存 约束的数据结构。 实现 LRUCache 类: * LRUCache(int capacity) 以 正整数 作为容量 capacity 初始化 LRU 缓存 * int get(int key) 如果关键字 key 存在于 ......
双向 实战 LeetCode LRU

LeetCode 周赛 347(2023/05/28)二维空间上的 LIS 最长递增子序列问题

> **本文已收录到 [AndroidFamily](https://github.com/pengxurui/AndroidFamily),技术和职场问题,请关注公众号 [彭旭锐] 提问。** - 往期回顾:[LeetCode 单周赛第 346 场 · 仅 68 人 AK 的最短路问题](http ......
序列 LeetCode 问题 空间 2023

LeetCode 652. 寻找重复的子树

```c class Solution { public: vector res; unordered_map hashmap;//记录每一个子树出现的次数 string dfs(TreeNode* root) { if(!root) return ""; string str=""; str+=t ......
LeetCode 652

LeetCode-Java题解 977. Squares of a Sorted Array

题目地址:[977. Squares of a Sorted Array](https://leetcode.cn/problems/squares-of-a-sorted-array/) 解题思路: 又是一道双指针的题目,看见秒想到双指针(平方直接调用sort方法也行,但是这么写这题就没意思了)。 ......
题解 LeetCode-Java LeetCode Squares Sorted

leetcode第105场双周赛

# 6394. 字符串中的额外字符 使用动态规划求解 详见代码: ```cpp class Solution { public: int minExtraChar(string s, vector& ct) { int n=s.size(); vector dp(n+1,n); dp[0]=0; f ......
leetcode 105

力扣 662 https://leetcode.cn/problems/maximum-width-of-binary-tree/

需要了解树的顺序存储 如果是普通的二叉树 ,底层是用链表去连接的 如果是满二叉树,底层用的是数组去放的,而数组放的时候 会有索引对应 当前父节点是索引i,下一个左右节点就是2i,2i+1 利用满二叉树的索引特征 所以需要对每个节点进行一个索引赋值,赋值在队列中,队列用数组表示 核心代码如下 publ ......

LeetCode 114. 二叉树展开为链表

# 思路1 ``` class Solution { public: void flatten(TreeNode* root) { while(root) { auto p=root->left; if(p)//找到左儿子的右链 { while(p->right) p=p->right; //将右链 ......
LeetCode 114

2023CVPR_Learning a Simple Low-light Image Enhancer from Paired Low-light Instances(PairLLE)无监督

一. motivation 以前的大多数LIE算法使用单个输入图像和几个手工制作的先验来调整照明。然而,由于单幅图像信息有限,手工先验的适应性较差,这些解决方案往往无法揭示图像细节。 二. contribution 1. 提出一个成对低光图像输入(相同内容,不同的曝光度) 2. 在输入之前进行了一个 ......
Low-light light CVPR_Learning Instances Low

Github疯传!谷歌师兄的LeetCode刷题笔记开源了!

有小伙伴私聊我说刚开始刷LeetCode的时候,感到很吃力,刷题效率很低。我以前刷题的时候也遇到这个问题,直到后来看到这个谷歌师兄总结的刷题笔记,发现LeetCode刷题都是套路呀,掌握这些套路之后,就变得非常简单了! 这份笔记是作者在找工作的时候,刷了几百道的LeetCode题目,然后按照数据结构 ......
师兄 LeetCode 笔记 Github

Leetcode2585. 获得分数的方法数

![](https://img2023.cnblogs.com/blog/2533795/202305/2533795-20230525220020580-913191077.png) ## 题解 多重背包的模板 f[i][j]表示前i种题目得分为j的方案数 f[i][j] += f[i-1][j- ......
分数 Leetcode 方法 2585

LeetCode/最小面积矩形

给一系列顶点,计算这些点能组成矩形的最小面积 ###1. 最小面积矩形(列举对角线+哈希) **矩形的边平行于x轴和y轴** 通过双重循环列举对角线顶点,计算满足条件的矩形面积 ``` class Solution { public: int minAreaRect(vector>& points) ......
矩形 LeetCode 面积

[LeetCode] 2451. Odd String Difference

You are given an array of equal-length strings words. Assume that the length of each string is n. Each string words[i] can be converted into a differe ......
Difference LeetCode String 2451 Odd

每日一题 力扣 1377 https://leetcode.cn/problems/frog-position-after-t-seconds/

力扣 1377 https://leetcode.cn/problems/frog-position-after-t-seconds/ 这道题目用dp去做,构建邻接矩阵,做的时候需要注意题目条件,如果青蛙跳不动了,这个概率就保持不变了 一般跳青蛙,很容易想到dp 核心代码如下 public doub ......

Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT

Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT ......

[LeetCode] 1344. Angle Between Hands of a Clock 时钟指针的夹角

Given two numbers, `hour` and `minutes`, return *the smaller angle (in degrees) formed between the *`hour`* and the *`minute`* hand*. Answers within ` ......
夹角 指针 时钟 LeetCode Between

LeetCode 98. 验证二叉搜索树

``` class Solution { public: vector dfs(TreeNode* root)//依次返回是否是二叉搜索树,最大值最小值 { vector res{1,root->val,root->val}; if(root->left) { auto l=dfs(root->le ......
LeetCode 98