leetcode column equal pairs
用 Rust 生成 Ant-Design Table Columns
经常开发表格,是不是已经被手写Ant-Design Table的Columns整烦了?尤其是ToB项目,表格经常动不动就几十列。每次照着后端给的接口文档一个个配置,太头疼了,主要是有时还会粘错就尴尬了。那有没有办法能自动生成columns配置呢? ......
==与equals区别
``` java public class ll{ public static void main(String[] args) { String s1 = "abc"; String s2 = "abc"; String s3 = new String("abc"); String s4 = "a ......
[LeetCode] 1870. Minimum Speed to Arrive on Time
You are given a floating-point number hour, representing the amount of time you have to reach the office. To commute to the office, you must take n tr ......
[ABC308G] Minimum Xor Pair Query 题解
[Minimum Xor Pair Query](https://www.luogu.com.cn/problem/AT_abc308_g) ### 题目大意 维护一个序列,支持动态插入,删除,查询最小异或对。 ### 思路分析 看到查询最小异或对首先想到 01Trie,但 01Trie 不支持删除 ......
代码随想录算法训练营第一天| LeetCode 704. 二分查找、LeetCode 27. 移除元素
704. 二分查找 题目链接:https://leetcode.cn/problems/binary-search/ 视频链接:https://www.bilibili.com/video/BV1fA4y1o715 文章讲解:https://programmercarl.com/0704.%E4%B ......
1775.equal sum arrays with minimum number of operations
Description 1775.equal-sum-arrays-with-minmum-number-of-operations Solution hash table + greedy algorithm The general idea of this problem is hash + g ......
Schema-validation: wrong column type encountered in column [NAME] in table [BUS]; found [nvarchar2 (Types#NVARCHAR)], but expecting [varchar2(255 char) (Types#VARCHAR)]
属性的类型出错 NVARCHAR 和 VARCHAR 不同 @Column(name = "NAME", columnDefinition = "nvarchar2(50)") private String name; ......
LeetCode 560. 和为 K 的子数组
``` class Solution { public: int subarraySum(vector& nums, int k) { int n=nums.size(),res=0; vector s(n+1,0); unordered_map hash;//记录端点i之前所有前缀和的出现情况 f ......
Leetcode437. 路径总和 III
``` /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), ......
[LeetCode] 2013. Detect Squares
You are given a stream of points on the X-Y plane. Design an algorithm that: Adds new points from the stream into a data structure. Duplicate points a ......
Java面试题 P4:==和equals
==对比的是栈中的值,基本数据类型是变量值,引用类型是堆中内存对象的地址 new String(“abc”),实际上是指向了堆中的内存对象应用地址。 String str1=“Hello”; //放入堆中的常量池 String Str2=new String("Hello");//在堆中去分配内存, ......
go刷题Leetcode,生成文件夹与go文件模板
## go生成文件夹与模板 ### 起因 以前是用C/C++刷Leetcode时,将多个C/CPP文件放在同一个目录下,没有出任何问题,但是换成Go语言刷题。 在一个目录下创建多个go文件,每个文件都是以下 ```go package main func main(){ } ``` 在vscode下 ......
leetcode1448好节点深刻理解DFS+BFS
DFS 没有返回值 max在递归时要慎重用引用,因为在回溯时可能不能改变max; 因为节点的值可能有负数,所以最大值从根节点开始,根节点一定是好节点。 int goodNum=0; void dfs(TreNode* root,int max){ if(!root)return ; if(root- ......
C. Equal Frequencies
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef pair<int,int> PII; const int N=1e6+10,INF=0x3f3f3f3f; int n; string s; int ......
LeetCode 热题 100 之 53. 最大子数组和
# 题目 给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 子数组 是数组中的一个连续部分。 **示例 1:** 输入:nums = [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的和最大, ......
LeetCode 406. 根据身高重建队列
``` class Solution { public: struct node { int val; int pre; node* next; node(int a,int b,node* c) { val=a; pre=b; next=c; } }; void insert(node* &hea ......
[LeetCode] 2208. Minimum Operations to Halve Array Sum
You are given an array nums of positive integers. In one operation, you can choose any number from nums and reduce it to exactly half the number. (Not ......
leetcode第354场周赛 2 - 双指针
[题目传送门](https://leetcode.cn/contest/weekly-contest-354/) # [2779. 数组的最大美丽值](https://leetcode.cn/problems/maximum-beauty-of-an-array-after-applying-ope ......
LeetCode 热题 100 之 21. 合并两个有序链表
# 题目 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:** 输入:l1 = [1,2,4], l2 = [1,3,4] 输出:[1,1,2,3,4,4] **示例 2:** 输入:l1 = [], l2 = [] 输出:[] **示 ......
LeetCode 热题 100 之 560. 和为 K 的子数组.md
# 题目 给你一个整数数组 nums 和一个整数 k ,请你统计并返回 该数组中和为 k 的连续子数组的个数 。 **示例 1:** 输入:nums = [1,1,1], k = 2 输出:2 **示例 2:** 输入:nums = [1,2,3], k = 3 输出:2 **提示:** 1 int ......
[Leetcode Weekly Contest]355
链接:[LeetCode](https://leetcode-cn.com/contest/weekly-contest-355/) ## [Leetcode]6921. 按分隔符拆分字符串 给你一个字符串数组 words 和一个字符 separator ,请你按 separator 拆分 word ......
前端请求报错:'JSON parse error: syntax error, expect {, actual e…1, line 1, column 2selectUid%5B%5D=VluJeA9upFXgJD', code: '500'}
1、如果不用 JSON.stringify(inputJson) 包起来就会报错 let inputJson = {"selectUid" : selectUid}; var response = await $.ajax({ type: 'POST', url: 'xxx', data: inpu ......
LeetCode 热题 100 之 438. 找到字符串中所有字母异位词
# 题目 给定两个字符串 s 和 p,找到 s 中所有 p 的 异位词 的子串,返回这些子串的起始索引。不考虑答案输出的顺序。 异位词 指由相同字母重排列形成的字符串(包括相同的字符串)。 **示例 1:** 输入: s = "cbaebabacd", p = "abc" 输出: [0,6] 解释: ......
重写equals为什么要重写hashCode
我们知道一旦重写了equals方法,就一定要重写hashCode方法。为什么? 因为必须保证重写后的equals方法认定相同的两个对象拥有相同的哈希值 当我们将equals方法重写后有必要将hashCode方法也重写,这样做才能保证不违背hashCode方法中“相同对象必须有相同哈希值”的约定。 那 ......
LeetCode 热题 100 之 3. 无重复字符的最长子串
# 题目 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: s = "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 示例 2: 输入: s = "bbbbb" 输出: 1 解释: 因为无重复字符的最长子串 ......
idea解析sql语句报错:Unable to resolve column 'uname'
### 1. 如题 ![](https://img2023.cnblogs.com/blog/1517467/202307/1517467-20230724152638965-1018189430.png) ### 2. 解决办法 ![](https://img2023.cnblogs.com/bl ......
LeetCode 399. 除法求值
``` class Solution { public: vector calcEquation(vector>& equations, vector& values, vector>& queries) { unordered_set node;//记录所有节点 unordered_map> g; ......
LeetCode 周赛上分之旅 #34 按部就班地解决动态规划问题
> ⭐️ **本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 [彭旭锐] 和 [BaguTree Pro] 知识星球提问。** > > 学习数据结构与算法的关键在于掌握问题背后的算法思维框架,你的思考越抽象,它能覆盖的问题域就越广,理解难度也更复杂。在这个专栏里,小彭与你分享 ......
LeetCode 周赛上分之旅 #35 两题坐牢,菜鸡现出原形
> ⭐️ **本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 [彭旭锐] 和 [BaguTree Pro] 知识星球提问。** > > 学习数据结构与算法的关键在于掌握问题背后的算法思维框架,你的思考越抽象,它能覆盖的问题域就越广,理解难度也更复杂。在这个专栏里,小彭与你分享 ......
leetcode第109场双周赛
[题目传送门](https://leetcode.cn/contest/biweekly-contest-109/) # [6931. 访问数组中的位置使分数最大](https://leetcode.cn/problems/visit-array-positions-to-maximize-scor ......