rectangle leetcode number ships

[GUET-CTF2019]number_game

[GUET-CTF2019]number_game 打开题目,立刻定位关键函数 for ( i = 0; i <= 4; ++i ) { for ( j = 0; j <= 4; ++j ) { for ( k = j + 1; k <= 4; ++k ) { if ( *(&unk_601060 ......
number_game GUET-CTF number GUET 2019

代码随想录算法训练营第四天| LeetCode 24. 两两交换链表中的节点 19.删除链表的倒数第N个节点 142.环形链表II

24. 两两交换链表中的节点 卡哥建议:用虚拟头结点,这样会方便很多。 本题链表操作就比较复杂了,建议大家先看视频,视频里我讲解了注意事项,为什么需要temp保存临时节点。 题目链接/文章讲解/视频讲解:https://programmercarl.com/0024.%E4%B8%A4%E4%B8% ......
节点 随想录 环形 训练营 随想

LeetCode做题笔记

LeetCode做题笔记 3. 无重复字符的最长子串 最核心的就是维护一个字符串区间,同时保证其中的每个字符都只出现过一次。最最最暴力的就是枚举可能出现的每个字符串区间,然后确保里边元素不重复,然后找出最长的字符串有多少元素。再进一步的想法就是由小到大的构建这样的字符串。用双指针滑动窗口的思想来维护 ......
LeetCode 笔记

LeetCode 热题 100 之 56. 合并区间

# 题目 以数组 intervals 表示若干个区间的集合,其中单个区间为 intervals[i] = [starti, endi] 。请你合并所有重叠的区间,并返回 一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间 。 **示例 1:** 输入:intervals = [[1,3],[2, ......
区间 LeetCode 100 56

Leetcode448. 找到所有数组中消失的数字

``` class Solution { public: vector findDisappearedNumbers(vector& nums) { vector res; int n=nums.size(),offset=n+1; for(auto &num:nums) { int x=(num) ......
数组 Leetcode 数字 448

[LeetCode] 486. Predict the Winner

You are given an integer array nums. Two players are playing a game with this array: player 1 and player 2. Player 1 and player 2 take turns, with pla ......
LeetCode Predict Winner 486 the

代码随想录算法训练营第三天| LeetCode 203.移除链表元素(同时也对整个单链表进行增删改查操作) 707.设计链表 206.反转链表

203.移除链表元素 题目链接/文章讲解/视频讲解::https://programmercarl.com/0203.%E7%A7%BB%E9%99%A4%E9%93%BE%E8%A1%A8%E5%85%83%E7%B4%A0.html 卡哥题目建议:本题最关键是要理解虚拟头结点的使用技巧,这个对链 ......
随想录 训练营 随想 算法 LeetCode

LeetCode 239. Sliding Window Maximum 单调队列

You are given an array of integers `nums`, there is a sliding window of size `k` which is moving from the very left of the array to the very right. Yo ......
队列 LeetCode Sliding Maximum Window

Python - f-string number format

>>> print(f"int: {number: d}; hex: {number: 02X}; oct: {number: o}; bin: {number: b}")int: 12; hex: C; oct: 14; bin: 1100>>> print(f"int: {number: d}; ......
f-string Python string number format

Leetcode438. 找到字符串中所有字母异位词

``` class Solution { public: vector findAnagrams(string s, string p) { unordered_map window,hash; vector res; for(auto i:p) hash[i]++; for(int i=0,j=0 ......
字符串 字母 字符 Leetcode 438

代码随想录算法训练营第二天| LeetCode 977.有序数组的平方 ,209.长度最小的子数组 ,59.螺旋矩阵II

977.有序数组的平方 题目链接:https://leetcode.cn/problems/squares-of-a-sorted-array/ 文章讲解:https://programmercarl.com/0977.%E6%9C%89%E5%BA%8F%E6%95%B0%E7%BB%84%E7% ......
数组 随想录 训练营 矩阵 螺旋

2023“钉耙编程”中国大学生算法设计超级联赛(4)Number Table

### 题意 > 对于一个$2\times n$的矩阵,若每行每列数均不同且均$\in[0,2^k)$,同时$2n$个数异或和为$0$则称该矩阵合法。给定$n,k$,求总方案数。 ### 做法 考虑若只有一行,即求$n$个不相同的数异或和为$0$的方案数: 假定前$n-1$个数不同且已确定,此时仅需 ......
钉耙 算法 联赛 大学生 Number

ChatGPT 在JavaScript中,由于Number类型只能表示52位精度,因此默认情况下无法进行超过16位的乘法运算

ChatGPT 在JavaScript中,由于Number类型只能表示52位精度,因此默认情况下无法进行超过16位的乘法运算。但是,你可以使用BigInt来处理大数字。 BigInt是目前JavaScript中处理超出Number精度限制的数字的最佳方式。它是一种新的数据类型,可以表示任意精度的整数 ......
乘法 精度 JavaScript ChatGPT 类型

[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 ......
LeetCode Minimum Arrive Speed 1870

代码随想录算法训练营第一天| LeetCode 704. 二分查找、LeetCode 27. 移除元素

704. 二分查找 题目链接:https://leetcode.cn/problems/binary-search/ 视频链接:https://www.bilibili.com/video/BV1fA4y1o715 文章讲解:https://programmercarl.com/0704.%E4%B ......
LeetCode 随想录 训练营 随想 算法

871.minimum number of refueling stops

Description 871.minimum-number-of-refueling-stops Solution Dynamic programming In this problem, the number is finite, and there is a recurrence relati ......
refueling minimum number stops 871

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 ......
operations minimum arrays number equal

1798.maximum number of consecutive values you can make

Description 1798.maximum-number-of-consecutive-values-you-can-make Solution Greedy algorithm + dynamic programming First, we sort the array in ascendi ......
consecutive maximum number values 1798

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 ......
数组 LeetCode 560

Leetcode437. 路径总和 III

``` /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), ......
总和 路径 Leetcode 437 III

[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 ......
LeetCode Squares Detect 2013

go刷题Leetcode,生成文件夹与go文件模板

## go生成文件夹与模板 ### 起因 以前是用C/C++刷Leetcode时,将多个C/CPP文件放在同一个目录下,没有出任何问题,但是换成Go语言刷题。 在一个目录下创建多个go文件,每个文件都是以下 ```go package main func main(){ } ``` 在vscode下 ......
文件 文件夹 Leetcode 模板

leetcode1448好节点深刻理解DFS+BFS

DFS 没有返回值 max在递归时要慎重用引用,因为在回溯时可能不能改变max; 因为节点的值可能有负数,所以最大值从根节点开始,根节点一定是好节点。 int goodNum=0; void dfs(TreNode* root,int max){ if(!root)return ; if(root- ......
节点 leetcode 1448 DFS BFS

Staples Drop Ship EDI 需求分析

Staples 是一家美国零售公司,总部位于马萨诸塞州弗拉明汉,主要提供支持工作和学习的产品和服务。该公司于 1986 年在马萨诸塞州布莱顿开设了第一家门店。到 1996 年,该公司已跻身《财富》世界 500 强,后来又收购了办公用品公司 Quill Corporation。近几年 Staples ......
需求 Staples Drop Ship EDI

LeetCode 热题 100 之 53. 最大子数组和

# 题目 给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 子数组 是数组中的一个连续部分。 **示例 1:** 输入:nums = [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的和最大, ......
数组 LeetCode 100 53

2023-07-25 uview1.0的u-number-box组件在渲染时会触发change,如何才能避免事件影响?==》设置判断条件并增加时间延迟

前言:购物车用到加减购物车数量的一个步进器组件,使用的是uview组件1.0版本的u-number-box。 该组件设置了一个@change事件,该事件会在页面渲染的时候触发一次,如果你在里面调用了接口,比如增加/减少购物车数量,那么每次一刷新购物车该事件就会被触发,从而导致不必要的报错。 解决方案 ......
u-number-box 组件 条件 事件 时间

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 身高 406

[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 ......
Operations LeetCode Minimum Halve Array

leetcode第354场周赛 2 - 双指针

[题目传送门](https://leetcode.cn/contest/weekly-contest-354/) # [2779. 数组的最大美丽值](https://leetcode.cn/problems/maximum-beauty-of-an-array-after-applying-ope ......
指针 leetcode 354

LeetCode 热题 100 之 21. 合并两个有序链表

# 题目 将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 **示例 1:** 输入:l1 = [1,2,4], l2 = [1,3,4] 输出:[1,1,2,3,4,4] **示例 2:** 输入:l1 = [], l2 = [] 输出:[] **示 ......
LeetCode 两个 100 21