leetcode column equal pairs
[Leetcode] 0709. 转换成小写字母
# [709. 转换成小写字母](https://leetcode.cn/problems/to-lower-case) 点击上方跳转至Leetcode ## 题目描述 给你一个字符串 s ,将该字符串中的大写字母转换成相同的小写字母,返回新的字符串。 示例 1: 输入:s = "Hello" 输出 ......
[Leetcode] 0717. 1 比特与 2 比特字符
# [717. 1 比特与 2 比特字符](https://leetcode.cn/problems/1-bit-and-2-bit-characters) 点击上方,跳转至leetcode ## 题目描述 有两种特殊字符: 第一种字符可以用一比特 0 表示 第二种字符可以用两比特(10 或 11) ......
[Leetcode] 0706. 设计哈希映射
# [706. 设计哈希映射](https://leetcode.cn/problems/design-hashmap) 点击跳转至leetcode ## 题目描述 不使用任何内建的哈希表库设计一个哈希映射(HashMap)。 实现 MyHashMap 类: MyHashMap() 用空映射初始化对 ......
Integer、Long包装类的比较==/equals
@Test void test() { Long i = Long.valueOf(-1); Long j = Long.valueOf(1); Long k = 1L; Long m = 100L; Long u = 200L; System.out.println(i 1); System.ou ......
(Leetcode)将数组按照绝对值大小从大到小排序
【少说多做,少想多做】 ```java nums = IntStream.of(nums). boxed(). sorted((o1,o2)->Math.abs(o2)-Math.abs(o1)) .mapToInt(Integer::intValue).toArray(); ``` + IntSt ......
[LeetCode] 2090. K Radius Subarray Averages
You are given a 0-indexed array nums of n integers, and an integer k. The k-radius average for a subarray of nums centered at some index i with the ra ......
每日一题力扣 1262 https://leetcode.cn/problems/greatest-sum-divisible-by-three/
、 题解 这道题目核心就算是要知道如果x%3=2的话,应该要去拿%3=1的数字,这样子才能满足%3=0 贪心 sum不够%3的时候,就减去余数为1的或者余数为2的 需要注意 两个余数为1会变成余数为2的,所以可能减去2个余数为1 核心代码如下 public int maxSumDivThreeOth ......
Codeforces Round 880 (Div. 2) C. k-th equality
看好久题目了,题目大意是给定三个位数A,B,C和一个k,要求求所有满足要求的a+b=c等式中的第k个等式 等式按字典序由小到大枚举,例如1+9=10和2+6=8中1+9=10比2+6=8小 思路我们首先求出a,b,c的取值范围,然后先确定a,对于每一个确定的a都有一个确定的b和c区间与之对应,并且a ......
Loop or Iterate over all or certain columns of a dataframe in Python-pandas 遍历pandas dataframe的所有列
In this article, we will discuss how to loop or Iterate overall or certain columns of a DataFrame? There are various methods to achieve this task.Let’ ......
[LeetCode] 1262. Greatest Sum Divisible by Three
Given an integer array nums, return the maximum possible sum of elements of the array such that it is divisible by three. Example 1: Input: nums = [3, ......
LeetCode 周赛 350(2023/06/18)01 背包变型题
> **本文已收录到 [AndroidFamily](https://github.com/pengxurui/AndroidFamily),技术和职场问题,请关注公众号 [彭旭锐] 和 [BaguTree Pro] 知识星球提问。** - 往期回顾:[LeetCode 单周赛第 348 场 · 数 ......
2712. Minimum Cost to Make All Characters Equal (Medium)
Description 2712. Minimum Cost to Make All Characters Equal (Medium) You are given a 0-indexed binary string s of length n on which you can apply two ......
2712.minimum Cost to Make All Characters Equal
Description 2712. Minimum Cost to Make All Characters Equal (Medium) You are given a 0-indexed binary string s of length n on which you can apply two ......
Leetcode Hot 100 & 239. Sliding Window Maximum
参考资料: Python文档heapq部分 考点:子串 & [题干] 1 Input: nums = [1,3,-1,-3,5,3,6,7], k = 3 2 Output: [3,3,5,5,6,7] 3 Explanation: 4 Window position Max 5 6 [1 3 -1 ......
【LeetCode哈希表】前k个高频词,利用哈希表+vector进行排序操作
### 前k个高频词 https://leetcode.cn/problems/top-k-frequent-words/ 给定一个单词列表 words 和一个整数 k ,返回前 k 个出现次数最多的单词。 返回的答案应该按单词出现频率由高到低排序。如果不同的单词有相同出现频率, 按字典顺序 排序。 ......
Leetcode Hot 100 & 560. Subarray Sum Equals K
参考资料: 考点:子串 & [题干] 1 Input: nums = [1,1,1], k = 2 2 Output: 2 这道题说实话看得我一脸懵,第一时间想到的自然是双层循环遍历的一个$O(n^2)$的解法,也就是官方的解法一。但是使用这种解法会超时(Python语言是这样的,评论区有人提到了) ......
“==”和“equals”的区别
“==”既可以比较引用对象,也可以比较基本数据类型。当是引用对象时,比较其地址是否一样,是否为同一对象。基本数据类型则比较其值。 “equals” 是object的一个方法。比较时看是否重写equals方法。默认是比较是否为同一对象,但是例如 String类重写了,可以比较字符串值是否相等。 ......
leetcode735行星碰撞vector模拟栈操作
vector的基本操作: vector<int >v; v.back();//获取尾部数据 v.front();//获取首部数据 v.push_back(3);//在尾部加入数据3 v.pop_back();//弹出尾部数据 首先只有前一个行星向右走,后一个行星向左走才可能相撞。也就是一正一负的组合 ......
pair的使用
# 介绍pair pair,顾名思义,就是一对数据,而且他们的数据类型也可以不同。 # pair 的用法 ## **声明** ```cpp pair a; // 创建一对first类型为int,second类型为string的数据 pair a(114514, "homo"); // 创建一对fir ......
VUE使用Element-ui表达式拼接字符串 el-table-column的prop拼接字符串 拼接table 使用<template slot-scope="scope"> 更改td里面值
VUE使用Element-ui表达式拼接字符串 el-table-column的prop拼接字符串 `使用 更改td里面值` https://blog.csdn.net/WindNolose/article/details/125422409 描述 VUE中的标签属性,可以在属性前使用:,让属性绑定 ......
leetcode:vim模式下esc代码区失焦问题
# 问题 刷力扣时用的vim模式编码,当按下esc退出插入模式的时候,发现编辑的焦点直接从代码区退出了,还想继续往下敲代码就只能再次点鼠标 ![](https://img2023.cnblogs.com/blog/1562252/202306/1562252-20230615095452544-14 ......
子类重写equals
Java的equals()方法是在Object超类中定义的,其他例如String类调用的equals()方法都是被重写过的: > Object类中的equals()方法: ```Java public boolean equals(Object obj) { return (this == obj) ......
【LeetCode双指针】合并两个有序数组,从后向前遍历
### 合并两个有序数组 https://leetcode.cn/problems/merge-sorted-array/ 给你两个按 非递减顺序 排列的整数数组 nums1 和 nums2,另有两个整数 m 和 n ,分别表示 nums1 和 nums2 中的元素数目。 请你 合并 nums2 到 ......
Leetcode
1.两数之和 题目链接:1. 两数之和 - 力扣(LeetCode) 给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素在答案里不能重复出现。 ......
leetcode2390双指针一个指针写一个指针读
while(scan<s.size()){ if(s[scan]== '*'){ write==0?write:write--; scan++; continue; } s[write++]=s[scan++]; return s.substr(0,write); } ......
How many ways of selecting/referring to a column in data.table?
# Load demo data ``` library(data.table) flights = fread("https://raw.githubusercontent.com/Rdatatable/data.table/master/vignettes/flights14.csv") fli ......
[LeetCode] 1348. Tweet Counts Per Frequency 推文计数
A social media company is trying to monitor activity on their site by analyzing the number of tweets that occur in select periods of time. These perio ......
Leetcode常见报错的原因分析
问题1 问题描述 Line 522: Char 69: runtime error: applying non-zero offset 18446744073709551615 to null pointer (basic_string.h) 报错原因 string res = 0 报错分析 这里报 ......
Vscdoe 通过cookie 登陆美区 LeetCode
安装插件 vscode 安装leetcode插件。 使用cookie登陆 如果选择使用github登陆leetcode.com,似乎会有无法提交和测试的bug,而用cookie登陆就没有这个问题 使用edge获取cookie 使用Firefox获取的cookie有问题,无法正常登陆 右键,选择检查 ......