leetcode 100 top 02

【DP】LeetCode 62. 不同路径

题目链接 62. 不同路径 思路 代码 class Solution { public int uniquePaths(int m, int n) { int[][] dp = new int[m][n]; Arrays.fill(dp[0], 1); for(int i = 0; i < m; i ......
路径 LeetCode 62

leetcode top100-01

最好能说明一下为什么不怕重复。看评论里有很多人提出这个问题,说hash冲突。 我在这里解答一下这个问题。 1.每次写入时,判断条件 不是当前的key本身存不存在,而是key和 tag 之间的差值存不存在,这一点很重要。 2.题目命题说明了一点,假定只有一个解。也就是说重复元素再多都无所谓。 case ......
leetcode 100 top 01

leetcode top100 - 02

坑 转换成数字进行运算,最后转换成链表。可能会出现溢出的情况。 因为无论是int还是long类型表达的数字长度是有限的,而链表的长度是可以无限追加的。 解释是干扰你的,其实就是依次从低位到高位的进位过程 笔试思路 把链表依次填充到数组中,数组容易操作,然后逐位进行加法运算; 面试思路 使用链表的思路 ......
leetcode 100 top 02

02-第二章跨站脚本攻击分类

其余web文章参考:web学习目录 XSS XSS漏洞的验证 可以使用一段简单的代码, 验证和检测漏洞的存在, 这样的代码叫做POC(Proof of Concept) alert(/xss/); 告警 confirm('xss'); 确定 prompt('xss');提示 <script>aler ......
脚本 第二章 02

Leetcode19. 删除链表的倒数第 N 个结点

19. 删除链表的倒数第 N 个结点 自己纯手写第一题,递归有点冗杂,开辟了虚拟头节点,而且要特别注意边界条件(当倒数第n个正好是头节点时)。 ** * Definition for singly-linked list. * struct ListNode { * int val; * ListN ......
结点 Leetcode 19

单链表的实现【02】:Student-Management-System

一、问题引入 单链表的实现【01】:Student-Management-System 只体现了项目功能实现,未对代码部分做出说明。 故新增随笔进行补充说明代码部分。 重构代码,迭代版本:Student Mangement System(Version 2.0) 二、解决过程 基于单链表实现就离不开 ......

How to get indices of top-K values from a numpy array

How to get indices of top-K values from a numpy array np.argpartition(probs,-5)[-5:] ......
indices values array numpy top-K

Linux 进程管理 | ps、top、kill

ps 可显示系统进程状况 top 可动态显示进程状况 kill 用来结束进程 ps(Process Status) ps 命令用来列出系统中当前运行的进程,就是执行 ps 命令时的进程 执行 ps -auxwwf 结果如下图: 结果信息 USER 运行该进程的用户 PID 运行着的命令(CMD)的进 ......
进程 Linux kill top

LaTeX #02# 参考文献管理

以下为gpt生成。 第一,下载文献管理软件Zotero,记得安装对应浏览器插件 在Zotero中管理参考文献:首先,确保你已经安装了Zotero,并创建一个用于存放你论文参考文献的文件夹。将你需要引用的文献添加到这个文件夹中。你可以通过直接搜索、导入BibTeX条目、从网站抓取等多种方法添加文献。 ......
参考文献 文献 LaTeX 02

代码随想录Day16-Leetcode104. 二叉树的最大深度,111.二叉树的最小深度 ,222.完全二叉树的节点个数

104. 二叉树的最大深度 首先是层序遍历 /** * Definition for a binary tree node. * function TreeNode(val, left, right) { * this.val = (val undefined ? 0 : val) * this.l ......
深度 随想录 节点 随想 个数

Keep English Level-02

change -- n 零钱 climate change -- 气候变化 exchange -- 交换,兑换(金融) exchange rate -- 汇率 move -- 感动,改变,移动 (n) 行动,举措 movement to back such radical moves -- 支持这种 ......
English Level Keep 02

Java简单实现MQ架构和思路02

Java MQ的100个功能清单 有重复的 一个消息队列(MQ)可以有以下功能: 批量发送消息:允许将多个消息打包成一个批次发送,可以减少网络传输开销和提高系统吞吐量。 消息过期时间:消息可以设置一个过期时间,如果在指定时间内没有被消费者消费,将自动被丢弃。 消息顺序保证:在某些场景下,消息的顺序非 ......
架构 思路 Java

02 登录

登录原理: <template> <div id="login"> <div class="main-box"> <div :class="['container', 'container-register', { 'is-txl': isLogin }]"> <!-- 登录 --> <el-for ......
02

LeetCode 287. 寻找重复数

LeetCode 287. 寻找重复数 题目 \287. 寻找重复数 中等 2.1K 相关企业 给定一个包含 n + 1 个整数的数组 nums ,其数字都在 [1, n] 范围内(包括 1 和 n),可知至少存在一个重复的整数。 假设 nums 只有 一个重复的整数 ,返回 这个重复的数 。 你设 ......
LeetCode 287

代码随想录Day15-Leetcode102. 二叉树的层序遍历,226.翻转二叉树,101. 对称二叉树

102. 二叉树的层序遍历 题目链接:https://leetcode.cn/problems/binary-tree-level-order-traversal/ bfs,队列,记录下本层的数量和下一层的数量 /** * Definition for a binary tree node. * f ......
随想录 随想 Leetcode 代码 Day

【DP】LeetCode 剑指 Offer 60. n个骰子的点数

题目链接 剑指 Offer 60. n个骰子的点数 思路 动态规划问题中,只用考虑第 n 个阶段如何由第 n-1 个阶段转化过来 在本题中,就是投掷 n 个骰子的结果如何由 投掷 n-1 个骰子的结果转化过来。 代码 class Solution { public double[] dicesPro ......
骰子 点数 LeetCode Offer 60

02-第二章PHP数组

其余web文章参考:web学习目录 学习本章知识需要先学会:06-第六篇 前端代码审计的01-第一篇 HTML语言中,关于表单的部分 php文件上传功能$_FILES 用于接收上传的文件相关信息 写两个html,一个用来接收,一个用来上传: 上传文件如下代码: $_FILES:用来上传文件,代码如下 ......
数组 第二章 PHP 02

读SQL进阶教程笔记02_三值逻辑和NULL

1. 三值逻辑 1.1. 真 1.1.1. true 1.2. 假 1.2.1. false 1.3. 不确定 1.3.1. unknown 2. 两种NULL 2.1. 未知”(unknown) 2.1.1. 不知道戴墨镜的人眼睛是什么颜色 2.1.2. 虽然现在不知道,但加上某些条件后就可以知道 ......
进阶教程 逻辑 笔记 教程 NULL

[Algorithm] Dynamic programming - 02 - Longest Common Subsequence - Drawing 2d matrix + back tracing

Write a function that takes in two strings and returns their longest common subsequence. A subsequence of a string is a set of characters that aren't ......

通过 N 个线程顺序循环打印从 0 至 100

using System; using System.Threading; class PrintThread { private int id; private int totalThreads; private int startNum; private int endNum; private ......
线程 顺序 100

两个线程交替打印 0~100 的奇偶数

import threading class PrintThread(threading.Thread): def __init__(self, start_num, step, max_num): super(PrintThread, self).__init__() self.start_num ......
奇偶数 奇偶 线程 两个 100

day02-功能实现02

功能实现02 6.功能05-显示家居信息 6.1需求分析 进入后台系统,可以在页面进行所有家居信息的展示 6.2思路分析 完成从后端代码从mapper(dao层)-->Service层-->Controller层,并对代码进行测试 完成前端代码,使用axios发送http请求,返回所有家居信息,将数 ......
功能 day 02

leetcode-1089-easy

Duplicate Zeros Given a fixed-length integer array arr, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that ele ......
leetcode 1089 easy

leetcode-1009-easy

Complement of Base 10 Integer The complement of an integer is the integer you get when you flip all the 0's to 1's and all the 1's to 0's in its binar ......
leetcode 1009 easy

leetcode-1317-easy

Convert Integer to the Sum of Two No-Zero Integers No-Zero integer is a positive integer that does not contain any 0 in its decimal representation. Gi ......
leetcode 1317 easy

02web服务器3.29

web服务器 技术 ASP 微软,国内最早出的就是asp 在html里嵌入VB的脚本,asp+com; 在asp开发中,基本一个页面都有几千行,页面及其混乱。 维护成本高 c# lls <h1> <% System.out.println("hello") %> </h1> php PHP开发速度很 ......
服务器 3.29 web 02 29

【LeetCode】35.搜索插入位置

题目描述 解法 思路:二分查找 class Solution { public: int searchInsert(vector<int>& nums, int target) { int left = 0, right = nums.size() - 1; int count = 0; if(nu ......
LeetCode 位置 35

【LeetCode】278.第一个错误的版本

题目描述 解法 思路:二分查找 注意:当第一个 isBadVersion(mid)的结果为true时,得到第一个错误的版本 // The API isBadVersion is defined for you. // bool isBadVersion(int version); class Sol ......
LeetCode 错误 版本 278

【LeetCode】704.二分查找

题目描述 解法 class Solution { public: int search(vector<int>& nums, int target) { int left = 0; int right = nums.size()-1; while(left <= right){ int mid = ......
LeetCode 704

02-网络安全-网站协议请求报文(基础篇)

1.web应用程序技术 什么是http协议? HTTP:超文本传输协议。 可以实现客户端通过浏览器获取服务端数据信息,然后通过浏览器显示出来; 客户端可以通过浏览器提交信息到服务器端后台程序(数据库服务器、缓存服务器)。 如何提交信息到服务器端呢? http请求与响应报文(类似于寄信时,填写地址等提 ......
报文 网络安全 基础 网络 网站