之和leetcode 18

代码随想录 day18 找树左下角的值 路径总和 从中序与后序遍历序列构造二叉树

找树左下角的值 最简单就是想到层序遍历之后取第一个位置元素就是了 递归的话需要先判断哪里最深的节点 至于最左 保持中左右的遍历顺序 第一次得到最大深度处就是最左的 路径总和 有点像查找子树路径 所以递归回溯是比较好的选择 在求路径的适合,targetSum - node->val 是否为0的判断比一 ......
随想录 总和 序列 随想 路径

【LeetCode 2701. 连续递增交易】MySQL用户变量编程得到严格递增连续子序列的开始位置,结束位置,长度等统计信息

题目地址 https://leetcode.cn/problems/consecutive-transactions-with-increasing-amounts/ 代码 # Write your MySQL query statement below with t1 as( select * # ......
位置 序列 变量 长度 LeetCode

三数之和与四数之和 18

首先做的时候降重不好处理。看了卡哥的视频后知道几个关键点:(以四数之和为例) 1 最开始确定的两个数,要降重的话,必须当前数与上一个数不同,即nums[i]!=nums[i-1}。 之所以这样,而不是i+1,是因为是先要包含符合条件的案例,然后再排除。+的话就直接排除了。 2 left和right, ......
之和 18

【Leetcode 2474. 购买量严格增加的客户】MySQL用户变量编程解决严格递增连续子序列问题

题目地址 https://leetcode.cn/problems/customers-with-strictly-increasing-purchases/description/ 代码 # Write your MySQL query statement below with t1 as( se ......
购买量 序列 变量 Leetcode 客户

【LeetCode 2494. 合并在同一个大厅重叠的活动】MySQL用户变量编程解决区间合并问题

题目地址 https://leetcode.cn/problems/merge-overlapping-events-in-the-same-hall/ 代码 # Write your MySQL query statement below with t2 as( select * # 只需要改动这 ......
区间 变量 大厅 LeetCode 用户

【LeetCode1747. 应该被禁止的 Leetflex 账户】MySQL用户变量编程;尝试维护一个multiset

题目地址 https://leetcode.cn/problems/leetflex-banned-accounts/description/ 代码 with t1 as( select account_id,ip_address, login as tick, "login" as mytype ......
变量 账户 LeetCode Leetflex multiset

【Leetcode1949. 坚定的友谊】使用MySQL在无向图中寻找{"CompleteTripartite", {1, 1, 3}}这个pattern

题目地址 https://leetcode.cn/problems/strong-friendship/ 思路 就是在无向图中寻找这个pattern: (* Mathematica *) GraphData[{"CompleteTripartite", {1, 1, 3}}] SQL写还是比较麻烦。 ......

代码随想录 day17 平衡二叉树 二叉树的所有路径 左叶子之和

平衡二叉树 之前一直写迭代代码 没有怎么写递归 正好这题不是很好写迭代 练习一下递归 这题递归逻辑相对简单 左右子树高度差判断是不是大于一 可以直接返回结果 不大于一就高度max(l,r)+1 二叉树的所有路径 关键要点 这题适合先序遍历 回溯过程和递归过程是一起写的 进来几次就回溯几次 这样才能回 ......
随想录 之和 随想 路径 叶子

【LeetCode 2142. 每辆车的乘客人数 I】乘客到站等车,车到站载客。MySQL用户变量编程完成

题目地址 https://leetcode.cn/problems/the-number-of-passengers-in-each-bus-i/description/ 思路 将所有关键时刻作为tick。(同一时刻车和人同时到,默认人在车前到) 之后按照tick升序,使用MySQL用户变量编程完成 ......
乘客 变量 LeetCode 人数 用户

【LeetCode 】练习str_to_date函数;over(rows between CURRENT ROW AND 2 following)实现【当月和接下来2个月】滑动窗口

题目地址 https://leetcode.cn/problems/hopper-company-queries-iii/description/ 代码 -- CTE生成2020年每月的最后一天 WITH RECURSIVE months AS ( SELECT LAST_DAY('2019-12- ......

Ubuntu 23.04、22.04、20.04、18.04替换国内源

Ubuntu配置国内源 配置步骤如下: 1.Ubuntu配置文件位置:/etc/apt/sources.list 2.需要用root权限进入: sudo vi /etc/apt/sources.list 3.用vi、gedit等编辑工具打开文件进行修改 4.有2种修改方式 1.把原文件中:archi ......
04 Ubuntu 23.04 22.04 20.04

leetcode 15.三数之和

leetcode 15.三数之和 第十五题:三数之和 1.排序 + 双指针: 和两数之和不同,但可以转化为类似的思路,即确定一个数,去找数组中是否有另外两个数之和等于它的相反数。本题的难点在于如何去除重复解,如果是无序数组,则需要对每个值所在的位置进行记录并进行比较。但如果是有序数组且相加结果为0, ......
之和 leetcode 15

[LeetCode] 2085. Count Common Words With One Occurrence

Given two string arrays words1 and words2, return the number of strings that appear exactly once in each of the two arrays. Example 1: Input: words1 = ......
Occurrence LeetCode Common Count Words

【LeetCode 1635. Hopper 公司查询 I】with recursive生成2020年每月的最后一天

题目地址 https://leetcode.cn/problems/hopper-company-queries-i/description/ 代码 -- CTE生成2020年每月的最后一天 WITH RECURSIVE months AS ( SELECT LAST_DAY('2019-12-01 ......
recursive LeetCode Hopper 公司 1635

【LeetCode 2854. 滚动平均步数】MySQL过去n日滑动窗口

题目地址 https://leetcode.cn/problems/rolling-average-steps/description/ 代码 WITH t1 AS ( SELECT user_id, steps_date, CASE WHEN COUNT(steps_count) OVER ( P ......
步数 LeetCode MySQL 2854

【LeetCode 2989. 班级表现】T-SQL 动态sql编程示例

题目地址 https://leetcode.cn/problems/class-performance/description/ 题目大意 编写一个查询,计算学生获得的 最高分 和 最低分 之间的 总分差(3 次作业的总和)。 代码 /* Write your T-SQL query stateme ......
示例 班级 LeetCode 动态 T-SQL

【LeetCode 2994. 发生在周五的交易 II】with recursive生成2023-11月所有周五的日期

题目地址 https://leetcode.cn/problems/friday-purchases-ii/description/ 代码 # Write your MySQL query statement below WITH RECURSIVE Fridays (week_of_month, ......
recursive LeetCode 日期 2994 2023

【LeetCode2993. 发生在周五的交易 I】MySQL里尝试实现weekofmonth功能

题目地址 https://leetcode.cn/problems/friday-purchases-i/description/ 代码 # Write your MySQL query statement below with t1 as( SELECT *, DAYOFMONTH(purchas ......
weekofmonth LeetCode 功能 MySQL 2993

UM2003A 一款200 ~ 960MHz ASK/OOK +18dBm 发射功率的单发射芯片

UM2003A 是一款工作于 200 ~ 960MHz 频段的单片集成、高性能、可独立运行的 OOK 发射器。内部集成的 OTP 方便用户对各种射频参数以及特色功能进行编程。该芯片以其高集成度和低功耗的设计,特别适用于低成本,低功耗,电池驱动的无线发射应用。UM2003A 的工作载波频率是由一个低噪 ......
功率 芯片 2003A 2003 200

[LeetCode] 1363. Largest Multiple of Three 形成三的最大倍数

Given an array of digits digits, return the largest multiple of three that can be formed by concatenating some of the given digits in any order. If th ......
倍数 LeetCode Multiple Largest Three

18-权限分析:Kubernete 集群权限管理那些事儿

你好,我是正范。 通过前面的课程学习,你已经学会了使用kubectl命令行,或者直接发送 REST 请求,以及使用各种语言的 client 库来跟 APIServer 进行交互。那么你是否知道在这其中Kubernetes 是如何对这些请求进行认证、授权的呢?这节课,我们就来一探究竟。 任何请求访问 ......
权限 集群 事儿 Kubernete 18

day 1 LeetCode刷题日志

今天的内容是 704 和 27 ovo 704. 二分查找 给定一个 n 个元素有序的(升序)整型数组 nums 和一个目标值 target 写一个函数搜索 nums 中的 target,如果目标值存在返回下标,否则返回 -1 Myself C: //左闭右闭 [0,1,2,3] int searc ......
LeetCode 日志 day

【五期李伟平】CCF-A(MobiCom'18 Session EdgeTech'18)A Game-Theoretic Approach to Multi-Objective Resource Sharing and Allocation in Mobile Edge Clouds

Zafari, Faheem , et al. "A Game-Theoretic Approach to Multi-Objective Resource Sharing and Allocation in Mobile Edge Clouds." (2018). 为了缓解移动边缘计算中资源稀缺问 ......

leetcode 11.盛最多水的容器

leetcode 11.盛最多水的容器 第十一题:盛最多水的容器 1.暴力枚举: 会超时,但是做一些条件判断应该可以擦边过 public int maxArea(int[] height) { int max_result = 0; for (int i = 0;i<height.length-1; ......
容器 leetcode 11

古代辞官的说法18种

古代辞官的说法18种 明空当照2021-12-03 18:11 告老、解官、请老、乞身、乞骸骨、移病、谢病、致仕、解冠、解组、解绶、龟印、解印、解佩、致事、致政、休致、致禄。 1、告老还乡就是老病不堪厘务者和老疾不能任事者主动请辞,提前申请辞去官职,回到家乡,提前退休的情形。在我国古代主动要求“告老 ......
说法

[LeetCode] 2696. Minimum String Length After Removing Substrings

You are given a string s consisting only of uppercase English letters. You can apply some operations to this string where, in one operation, you can r ......
Substrings LeetCode Removing Minimum Length

力扣15-三数之和

难度:【中等】 没思路,简单粗暴三重循环安排上,已经尽量剪枝避免重复了。为了避免返回时出现重复的元组,将二维数组排序筛了一遍。提交后超出时间限制。 参考官方题解,优化三重循环到二重,提交后返回结果居然少了,哦想起来了我改了循环终止条件…… 手动过一遍出错的用例(不长)每一步的结果,找到原因了,是第二 ......
之和 15

LeetCode 872

Leaf-Similar Trees Leaf-Similar Trees - LeetCode Thinkings 二叉树无论先中后序遍历,所得叶子节点次序不变. Codes 我采用了非递归的中序遍历方式: /** * Definition for a binary tree node. * st ......
LeetCode 872

ubuntu 18.04.6 编译内核kernel提示 Can't find default configuration "arch/x86/configs/socfpga_deconfig"!

输入make socfpga_defconfig 的时候提示: ubuntu 18.04.6 编译内核kernel提示 Can't find default configuration "arch/x86/configs/socfpga_deconfig"! 解决办法: export ARCH=ar ......

实验18:迭代器模式

[实验任务一]:JAVA和C++常见数据结构迭代器的使用 信1305班共44名同学,每名同学都有姓名,学号和年龄等属性,分别使用JAVA内置迭代器和C++中标准模板库(STL)实现对同学信息的遍历,要求按照学号从小到大和从大到小两种次序输出学生信息。 实验要求: 1. 搜集并掌握JAVA和C++中常 ......
模式
共2770篇  :1/93页 首页上一页1下一页尾页