substitutions leetcode check after

LeetCode #485 最大连续 1 的个数

解题思路基础题,最后加一个特殊情况处理就好,时间复杂度O(n) 代码 class Solution {public: int findMaxConsecutiveOnes(vector<int>& nums) { int count=0; int Maxcount=0; for(int i =0; ......
个数 LeetCode 485

4月11日leetcode练习

设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。 实现 MinStack 类: MinStack() 初始化堆栈对象。void push(int val) 将元素val推入堆栈。void pop() 删除堆栈顶部的元素。int top() 获取堆栈顶部的元素。i ......
leetcode

leetcode 184

部门工资最高的员工 select d.name as Department, e.name as Employee, e.salary as Salary from Employee e left join Department d on e.departmentId = d.id where (e ......
leetcode 184

leetcode 183

从不订购的客户 select c.Name as Customers from Customers c left join Orders o on c.Id = o.CustomerId where o.CustomerId is null select customers.name custome ......
leetcode 183

leetcode 182

查找重复的电子邮箱 select email as Email from Person group by email having count(email) > 1 select email as Email from ( select email ,count(email) as c from P ......
leetcode 182

leetcode 181

超过经理收入的员工 select e1.name as Employee from Employee e1, Employee e2 where e1.managerId = e2.id and e1.salary > e2.salary select e1.name as Employee fro ......
leetcode 181

Jmeter 启动时报错:Not able to find Java executable or version. Please check your Java installation

安装java环境,cmd窗口中执行java-version 可以看到java的版本信息。 双击jmeter启动文件,报错:Not able to find Java executable or version. Please check your Java installation 解决办法: 在启 ......
Java installation executable 时报 version

【LeetCode回溯算法#extra01】集合划分问题【火柴拼正方形、划分k个相等子集、公平发饼干】

火柴拼正方形 https://leetcode.cn/problems/matchsticks-to-square/ 你将得到一个整数数组 matchsticks ,其中 matchsticks[i] 是第 i 个火柴棒的长度。你要用 所有的火柴棍 拼成一个正方形。你 不能折断 任何一根火柴棒,但你 ......
子集 正方形 正方 饼干 火柴

[LeetCode] 2390. Removing Stars From a String

You are given a string s, which contains stars *. In one operation, you can: Choose a star in s. Remove the closest non-star character to its left, as ......
LeetCode Removing String Stars 2390

leetcode 180

连续出现的数字 select distinct l1.num as ConsecutiveNums from Logs l1, Logs l2, Logs l3 where l1.id = l2.id - 1 and l2.id = l3.id - 1 and l1.num = l2.num and ......
leetcode 180

leetcode_打卡1

leetcode_打卡1 题目:1768. 交替合并字符串 解答: 思路: 模拟即可,字符串的提取: a.charAt(i) class Solution { public String mergeAlternately(String word1, String word2) { String re ......
leetcode

leetcode 178

分数排名 select s1.score, count(distinct s2.score) as `rank` from Scores as s1, Scores as s2 where s1.score <= s2.score group by s1.id order by s1.score d ......
leetcode 178

leetcode 177

第N高的薪水 CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT BEGIN declare T int default 0; SET T = N-1; RETURN ( # Write your MySQL query statement ......
leetcode 177

LeetCode 959. 有斜杠划分区域

题目: https://leetcode.cn/problems/regions-cut-by-slashes/description/ 题解(参考了讨论区):将初始N*N的网格看做4 * N* N的三角形集合,根据输入合并对应的三角形。 C# 实现 public class Solution { ......
斜杠 LeetCode 区域 959

Leetcode(剑指offer专项训练)——DFS/BFS专项(3)

重建序列 题目 给定一个长度为 n 的整数数组 nums ,其中 nums 是范围为 [1,n] 的整数的排列。还提供了一个 2D 整数数组 sequences ,其中 sequences[i] 是 nums 的子序列。 检查 nums 是否是唯一的最短 超序列 。最短 超序列 是 长度最短 的序列 ......
专项 Leetcode offer DFS BFS

_dbus_check_is_valid_member (method)

dbus[12630]: arguments to dbus_message_new_method_call() were incorrect, assertion "_dbus_check_is_valid_member (method)" failed in file dbus-message. ......

Check SID and SQL query associated with OS Process ID(PID) in Oracle

check Session id from OS process id in Oracle SELECT b.spid, a.sid, a.serial#, a.username, a.osuser FROM v$session a, v$process b WHERE a.paddr = b.ad ......
associated Process Oracle Check query

LeetCode习题——x 的平方根(二分查找)

### x 的平方根 力扣链接:[x 的平方根 ](https://leetcode.cn/problems/sqrtx/) #### 题目 > 给你一个非负整数 x ,计算并返回 x 的 算术平方根 。>> 由于返回类型是整数,结果只保留 整数部分 ,小数部分将被 舍去 。>> 注意:不允许使用任 ......
平方根 习题 LeetCode

【LeetCode动态规划#06】分割等和子集(01背包问题一维写法实战)

分割等和子集 分割等和子集 给你一个 只包含正整数 的 非空 数组 nums 。请你判断是否可以将这个数组分割成两个子集,使得两个子集的元素和相等。 示例 1: 输入:nums = [1,5,11,5] 输出:true 解释:数组可以分割成 [1, 5, 5] 和 [11] 示例 2: 输入:num ......
子集 写法 背包 实战 LeetCode

Leetcode(剑指offer专项训练)——DFS/BFS专项(2)

课程顺序 题目 现在总共有 numCourses 门课需要选,记为 0 到 numCourses-1。 给定一个数组 prerequisites ,它的每一个元素 prerequisites[i] 表示两门课程之间的先修顺序。 例如 prerequisites[i] = [ai, bi] 表示想要学 ......
专项 Leetcode offer DFS BFS

leetcode56.合并区间-java

1 class Solution { 2 public int[][] merge(int[][] intervals) { 3 /* 4 思路:左区间排序,若intervals[i][0] >= intervals[i-1][1]; 则重叠 5 将重叠区间新建放入res数组里,没重叠则放入原数组 ......
区间 leetcode java 56

Leetcode(剑指offer专项训练)——DP专项(8)

最长递增路径 题目 给定一个 m x n 整数矩阵 matrix ,找出其中 最长递增路径 的长度。 对于每个单元格,你可以往上,下,左,右四个方向移动。 不能 在 对角线 方向上移动或移动到 边界外(即不允许环绕)。 链接 DP 但是依旧不能覆盖所有的情况 class Solution { pub ......
专项 Leetcode offer

Raspberry Pi 3B won't turn on after being powered on All In One

Raspberry Pi 3B won't turn on after being powered on All In One 树莓派 3B 通电后无法开机 指示灯只有红色的 LED 亮,绿色的 LED 不亮了 ❓ 红色亮说明通电了,但是绿色不亮,即 ACT 指示灯工作异常 ✅ ......
Raspberry powered after being turn

LeetCode 双周赛 101,DP/中心位贪心/裴蜀定理/Dijkstra/最小环

本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 [彭旭锐] 提问。 大家好,我是小彭。 这周比较忙,上周末的双周赛题解现在才更新,虽迟但到哈。上周末这场是 LeetCode 第 101 场双周赛,整体有点难度,第 3 题似乎比第 4 题还难一些。 周赛大纲 2605. 从两个 ......
定理 LeetCode Dijkstra 101 DP

leetcode杨辉三角

给定一个非负整数 numRows,生成「杨辉三角」的前 numRows 行。 在「杨辉三角」中,每个数是它左上方和右上方的数的和。 出处:leetcode 对于此题可以建立一个vector<vector<int>>,对外层开辟numRows行,对内层开辟从零开始每次加一个,并把头尾都置为一,然后根据 ......
杨辉三角 leetcode

2023年4月8日leetcode练习心得

给你一个整数数组 nums,其中恰好有两个元素只出现一次,其余所有元素均出现两次。 找出只出现一次的那两个元素。你可以按 任意顺序 返回答案。 你必须设计并实现线性时间复杂度的算法且仅使用常量额外空间来解决此问题。 来源:力扣(LeetCode)链接:https://leetcode.cn/prob ......
leetcode 心得 2023

报错:django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues

这个错误是指在运行 Django 时系统检查发现了一些问题。通常这些问题涉及到模型定义、数据库设置或其他配置方面的错误 这个错误可能是由于模型定义中的字段关系导致的。具体来说,可能是模型中的两个字段拥有相同的 related_name,导致 Django 找不到正确的字段引用 解决这个问题的方法是使 ......

Leetcode(剑指offer专项训练)——DFS/BFS专项(1)

计算除法 题目 给定一个变量对数组 equations 和一个实数值数组 values 作为已知条件,其中 equations[i] = [Ai, Bi] 和 values[i] 共同表示等式 Ai / Bi = values[i] 。每个 Ai 或 Bi 是一个表示单个变量的字符串。 另有一些以数 ......
专项 Leetcode offer DFS BFS

LeetCode习题——在排序数组中查找元素的第一个和最后一个位置(二分查找)

在排序数组中查找元素的第一个和最后一个位置 力扣链接:在排序数组中查找元素的第一个和最后一个位置 题目 给你一个按照非递减顺序排列的整数数组 nums,和一个目标值 target。请你找出给定目标值在数组中的开始位置和结束位置。 如果数组中不存在目标值 target,返回 [-1, -1]。 你必须 ......
数组 习题 LeetCode 元素 位置

4月7日leetcode联系随笔,关于使用位运算找到数组中只出现一次的数字

给你一个整数数组 nums ,除某个元素仅出现 一次 外,其余每个元素都恰出现 三次 。请你找出并返回那个只出现了一次的元素。 你必须设计并实现线性时间复杂度的算法且不使用额外空间来解决此问题。 来源:力扣(LeetCode)链接:https://leetcode.cn/problems/singl ......
数组 leetcode 随笔 数字