矩阵leetcode 100 240

HOT100(除去前面做过的题)

最长回文子串 题目 中等 和最长回文子序列类似 自己的做法: class Solution { public String longestPalindrome(String s) { int len = s.length(); int max = 1; int left = 0, right = 0 ......
HOT 100

LeetCode -- 764. 最大加号标志

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

循环矩阵行列式

令 $f(x)=a_0+a_1x+\cdots+a_{n-1}x^{n-1}$. $$ \begin{bmatrix} a_0 & a_1 & \cdots & a_{n-1}\\ a_{n-1} & a_0 & \cdots & a_{n-2}\\ \vdots & \vdots & \ddots ......
行列式 矩阵 行列

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

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

2679. 矩阵中的和

给你一个下标从 0 开始的二维整数数组 nums 。一开始你的分数为 0 。你需要执行以下操作直到矩阵变为空: 矩阵中每一行选取最大的一个数,并删除它。如果一行中有多个最大的数,选择任意一个并删除。 在步骤 1 删除的所有数字中找到最大的一个数字,将它添加到你的 分数 中。 请你返回最后的 分数 。 ......
矩阵 2679

c语言刷leetcode——图

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

多线程知识:三个线程如何交替打印ABC循环100次

本文博主给大家讲解一道网上非常经典的多线程面试题目。关于三个线程如何交替打印ABC循环100次的问题。 > 下文实现代码都基于Java代码在单个JVM内实现。 ## 问题描述 给定三个线程,分别命名为A、B、C,要求这三个线程按照顺序交替打印ABC,每个字母打印100次,最终输出结果为: ``` A ......
线程 三个 知识 ABC 100

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

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

这100道Python面试题,你会做几道?【21~25题】

## 二十一、请介绍下TCP和UDP的区别 TCP(Transmission Control Protocol)和UDP(User Datagram Protocol)是两种常见的传输层协议,用于在计算机网络中传输数据。它们在数据传输方面有以下区别: 1. 连接导向 vs 无连接: TCP是面向连接 ......
Python 100 21 25

[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

leetcode649队列操作Dota2

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

美团太狠:100亿级分库分表,不停机迁移,如何处理?

文章很长,且持续更新,建议收藏起来,慢慢读![**疯狂创客圈总目录 博客园版**](https://www.cnblogs.com/crazymakercircle/p/9904544.html) 为您奉上珍贵的学习资源 : 免费赠送 :[**《尼恩Java面试宝典》**](https://www. ......
分表 分库 100

[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

惠斯通电桥与PT100的实际应用

本文讨论的是惠斯通电桥与PT100(热敏电阻)的实际应用,不讨论理论知识,关于惠斯通电桥的理论知识请看这篇文章:https://zhuanlan.zhihu.com/p/267085334 使用Multisim仿真,搭建一个电桥,其中R2,R3,R4都为120Ω,R1是阻值随温度变化的电阻,假设R1 ......
惠斯通电桥 通电 实际 100 PT

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

【DSY 4484】矩阵 题解(带限错排)

[DSY 传送门](http://xsy.gdgzez.com.cn/JudgeOnline/problem.php?cid=2046&pid=1)。 (带限制)错排问题。 神仙题。 ## Solution - 根据题目的问法,发现我们只想统计比给定矩阵 $A$ 小的矩阵,记这个矩阵为 $B$。 显 ......
题解 矩阵 4484 DSY

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

模拟嵌入式边缘计算卡设计方案:367-XC7Z100 板卡 基于zynq XC7Z100 FMC接口通用计算平台

基于zynq XC7Z100 FMC接口通用计算平台 一、板卡概述 北京太速科技板卡由SoC XC7Z100-2FFG900I芯片来完成卡主控及数字信号处理,XC7Z100内部集成了两个ARM Cortex-A9核和一个kintex 7的FPGA,通过PL端FPGA扩展FMC、光纤、IO等接口,PS ......
板卡 嵌入式 100 XC7 边缘

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