题号leetcode题目

LeetCode 206. 反转链表

``` /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x ......
LeetCode 206

链表补充题目

package SecondBrush.LinkedList; /** * 83. 删除排序链表中的重复元素 * 给定一个已排序的链表的头 head , 删除所有重复的元素,使每个元素只出现一次 。返回 已排序的链表 。 * */ /** * 这个题目自己就直接做出来了,只是循环条件少写了一个 cu ......
题目

LeetCode -- 764. 最大加号标志

利用动态规划的思想,把每个格子上下左右连续的1的个数算出来,再从头到尾遍历一遍即可获得答案。 c ++ class Solution { public: int orderOfLargestPlusSign(int n, vector<vector<int>>& mines) { vector<ve ......
加号 LeetCode 标志 764

做题日记:1881. 插入后的最大值(leetcode)

题目: >给你一个非常大的整数 n 和一个整数数字 x ,大整数 n 用一个字符串表示。n 中每一位数字和数字 x 都处于闭区间 [1, 9] 中,且 n 可能表示一个 负数 。 >你打算通过在 n 的十进制表示的任意位置插入 x 来 最大化 n 的 数值 ​​​​​​。但 不能 在负号的左边插入 ......
最大值 leetcode 日记 1881

c语言刷leetcode——图

[TOC] # 0.图和树的关系 1. 树是特殊的图,且是有向图 2. 树中没有环,而图中可能有 # 1.图的存储方式 - 图由点集和边集组成 - 图分为有向图和无向图,无向图可以理解为双向有向图 ## 1.1 邻接表 和 邻接矩阵 - 常见的图存储方式由邻接表(点集为核心)和邻接矩阵(边集为核心) ......
leetcode 语言

leetcode-682.棒球比赛

```go package main import ( "strconv" ) /* * @lc app=leetcode.cn id=682 lang=golang * * [682] 棒球比赛 */ // @lc code=start func sum(numbers []int) int { ......
棒球 leetcode 682

leetcode 1466 重新规划路线 题解

### 解题思路 执行用时:140 ms, 在所有 Go 提交中击败了100.00%的用户 内存消耗:16.8 MB, 在所有 Go 提交中击败了82.00%的用户 将连接图转化成有向图,用二维slice存放。 此处将连接的起点设置为`from`也就是graph的外层下标,将连接的目标设为`targ ......
题解 leetcode 路线 1466

LeetCode 200. 岛屿数量

``` class Solution { public: bool st[310][310]; int dx[4]={0,0,-1,1},dy[4]={-1,1,0,0}; int m,n; int numIslands(vector>& g) { int res=0; n=g.size(),m=g ......
岛屿 LeetCode 数量 200

LeetCode 169. 多数元素

``` class Solution { public: int majorityElement(vector& nums) { int cnt=1; int res=nums[0]; for(int i=1;i<nums.size();i++) { if(nums[i]==res) cnt++; ......
LeetCode 元素 169

2021年电赛题目基于互联网的摄像测量系统(D题)

基于互联网的摄像测量系统设计报告2021 年全国大学生电子设计竞赛试题<10cmO 拍摄方向θ1mx1m拍摄方向BA边长为1米的 正方形测试区域l互联网参赛注意事项(1) 11 月 4 日 8:00 竞赛正式开始。本科组参赛队只能在【本科组】题目中任选一题;高职 高专组参赛队在【高职高专组】题目中任 ......
题目 互联网 系统 2021

LRU 力扣 146 https://leetcode.cn/problems/lru-cache/

一道经典题目,用双向链表去做能够满足O1的复杂度 核心代码如下 class LRUCache { MyLinkedList myLinkedList; int size; int capacity; HashMap<Integer, MyNode> map; public LRUCache(int ......
lru-cache leetcode problems https cache

[LeetCode] 2024. Maximize the Confusion of an Exam

A teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to confuse the students by maximizing ......
Confusion LeetCode Maximize 2024 Exam

LeetCode

[剑指offer 05.替换空格](https://leetcode.cn/problems/ti-huan-kong-ge-lcof/) ```cpp class Solution { public: string replaceSpace(string s) { string out; for( ......
LeetCode

那些神奇的转化到坐标或网格上的题目

[AGC002E] Candy Piles [AGC015E] Mr.Aoki Incubator ......
网格 坐标 题目

Duel 大战 题目记录

和巨佬们打Duel CF863E 2000 一开始以为离散化一下线段树随便做做即可,结果Wa on 14人都麻了 后来一想要动态开店询问区间最值,结果没开ll 卡了好久 ......
题目 大战 Duel

leetcode649队列操作Dota2

基本操作 入队: queue.push() queue.push_back()//两者效果相同 出队: queue.pop(); queue.pop_back();//都从尾部操作 考虑两个因素:1.每个参议员的决定都由之后的参议员决定 2.决定禁用之后都不能在投票 queue<int>radian ......
队列 leetcode Dota2 Dota 649

【暑假题目】20030703 两数相加

两数相加 题目 请使用C++计算出2^2023与3^2023的和 题目分析 首先通过题目,我们将所求的两个加数看为a,b,我们可以关注到两个点: 1.首先要解决的是两个加数的求法,这里分别有两种求法: ①通过for循环求得a,b两个加数。 ②通过指数函数pow函数得到a,b两个加数。 在可以调用函数 ......
20030703 题目

[LeetCode] 2178. Maximum Split of Positive Even Integers

You are given an integer finalSum. Split it into a sum of a maximum number of unique positive even integers. For example, given finalSum = 12, the fol ......
LeetCode Integers Positive Maximum Split

[LeetCode] 2600. K Items With the Maximum Sum

There is a bag that consists of items, each item has a number 1, 0, or -1 written on it. You are given four non-negative integers numOnes, numZeros, n ......
LeetCode Maximum Items 2600 With

Leetcode: Algorithm

1. Boyer-Moore Voting Algorithm identify the majority element (frequency > n/2) class Solution { public int majorityElement(int[] nums) { int count = ......
Algorithm Leetcode

leetcode-1652-easy

Defuse the Bomb ``` You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n ......
leetcode 1652 easy

leetcode-1629-easy

Slowest Key ``` You have a bomb to defuse, and your time is running out! Your informer will provide you with a circular array code of length of n and ......
leetcode 1629 easy

js 异步 任务 题目解析(chatgpt bug了?)

最近遇到一道题如下,求输出结果 感觉还是蛮有意思的,找chatgpt做了一下 ```js async function async1(){ console.log('1'); await async2(); console.log('2'); } async function async2(){ c ......
题目 任务 chatgpt bug js

淘宝技术三面题目:分布式架构+红黑树+SpringMVC+设计模式

淘宝一面 Java容器有哪些?哪些是同步容器,哪些是并发容器? ArrayList和LinkedList的插入和访问的时间复杂度? java反射原理, 注解原理? 新生代分为几个区?使用什么算法进行垃圾回收?为什么使用这个算法? HashMap在什么情况下会扩容,或者有哪些操作会导致扩容? Hash ......

LeetCode 160. 相交链表

``` /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class ......
LeetCode 160

【笔试实战】LeetCode题单刷题-编程基础 0 到 1【三】

博客推行版本更新,成果积累制度,已经写过的博客还会再次更新,不断地琢磨,高质量高数量都是要追求的,工匠精神是学习必不可少的精神。因此,大家有何建议欢迎在评论区踊跃发言,你们的支持是我最大的动力,你们敢投,我就敢肝 ......
笔试 实战 LeetCode 基础

leetcode207 课程表(拓扑排序)

public boolean canFinish(int numCourses, int[][] prerequisites) { //每个点的入度 int[] d = new int[numCourses]; //邻接表定义 ArrayList<ArrayList<Integer>> list = ......
课程表 拓扑 leetcode 课程 207

Leetcode155. 最小栈

``` class MinStack { public: stack st; multiset s; MinStack() { } void push(int val) { st.push(val); s.insert(val); } void pop() { int val=st.top(); s ......
Leetcode 155

图-邻接表-leetcode207

你这个学期必须选修 ​​numCourses​​​ 门课程,记为 ​​0​​​ 到 ​​numCourses - 1​​ 。 在选修某些课程之前需要一些先修课程。 先修课程按数组 ​​prerequisites​​ 给出,其中 ​​prerequisites[i] = [ai, bi]​​ ,表示如 ......
leetcode 207

[LeetCode] 2679. Sum in a Matrix

You are given a 0-indexed 2D integer array nums. Initially, your score is 0. Perform the following operations until the matrix becomes empty: From eac ......
LeetCode Matrix 2679 Sum in