频率leetcode 895
LeetCode 3. Longest Substring Without Repeating Characters 滑动窗口
Given a string `s`, find the length of the longest substring without repeating characters. ## Solution 用一个 $dict$ 来映射字符的次数。然后用 $left$, $right$ 来决定wind ......
leetcode-2582-easy
Pass the Pillow ``` There are n people standing in a line labeled from 1 to n. The first person in the line is holding a pillow initially. Every secon ......
Leetcode394. 字符串解码
``` class Solution { public: string dfs(string s,int &idx) { string str; while(idx'0'&&s[idx]='0'&&s[idx]<='9') num+=s[idx++]; if(s[idx]=='[') { int c ......
leetcode 栈与队列 232 225
[toc] #基本介绍 栈,先进后出 队列,先进先出 ##四个问题 1. C++中stack 是容器么? 2. 我们使用的stack是属于哪个版本的STL? 3. 我们使用的STL中stack是如何实现的? 4. stack 提供迭代器来遍历stack空间么? 首先大家要知道 栈和队列是STL(C+ ......
[LeetCode] 1349. Maximum Students Taking Exam 参加考试的最大学生数
Given a `m * n` matrix `seats` that represent seats distributions in a classroom. If a seat is broken, it is denoted by `'#'` character otherwise it i ......
codility 和 leetcode 对比
根据网上的信息,codility 和 leetcode 都是用于评估编程技能的在线平台,它们都提供了不同难度和类型的编程挑战,支持多种编程语言,并可以用于招聘和面试的过程中。 不过,它们也有一些区别,比如: codility 更专注于工程团队的技能评估,它提供了 CodeCheck, CodeLiv ......
leetcode872叶相似树
这道题是考虑的深度优先搜索,使用递归 vecotr和queue入队操作并不相同: vector只能使用push_back(); queue既可以使用push()还可以使用push_back() void FindLeaf(TreeNode* root,vector<int>& v){ if(!roo ......
LeetCode 347. 前 K 个高频元素
# 快排思想 - 注意,这里是倒序排序,因此应该`while(nums[i].cnt>x);` ``` class Solution { public: struct element { int val,cnt; element(int a,int b) { val=a; cnt=b; } }; v ......
LeetCode -- 773. 滑动谜题
启发式搜索 class Solution { struct Node { string str; int x, y; int val; }; int n = 2, m = 3; string e = "123450"; int dx[4] = {-1, 0, 1, 0}; int dy[4] = { ......
咚咚咚————【封装驱动】Si5351A方波信号发生器发送任意(8K-160Mhz)频率程序
咚咚咚————【封装驱动】Si5351A方波信号发生器发送任意[8K-160Mhz]频率程序 (一)效果展示(二)源码分享(三)需要改进的地方及不足 (使用阿波罗STM32F7开发板) (一)效果展示 (二)源码分享 芯片SI5351A源代码下载 可以支持一下吗QAQ SI5351A.c /**** ......
ADC采样时间、采样周期、采样频率计算方法
一、概述 ADC转换就是输入模拟的信号量转换成数字量。读取数字量必须等转换完成后,完成一个通道的读取叫做采样周期。采样周期一般来说=转换时间+读取时间,而转换时间=采样时间+12.5个时钟周期。采样时间是你通过寄存器告诉STM32采样模拟量的时间,设置越长越精确 二、STM32 ADC采样频率的确定 ......
STM32F407定时器时钟频率和时钟源
(1)高级定时器timer1, timer8以及通用定时器timer9, timer10, timer11的时钟来源是APB2总线 (2)通用定时器timer2~timer5,通用定时器timer12~timer14以及基本定时器timer6,timer7的时钟来源是APB1总线 (3)当APB1和 ......
[LeetCode] 2297. Jump Game VIII
You are given a 0-indexed integer array nums of length n. You are initially standing at index 0. You can jump from index i to index j where i < j if: ......
leetcode 28 459 总结 KMP算法
[toc] #28 ##解法一,暴力法 ``` //暴力 if(haystack.length() pi(m); for (int i = 1, j = 0; i 0 && needle[i] != needle[j]) { j = pi[j - 1]; } if (needle[i] == nee ......
[LeetCode] 2408. Design SQL
You are given n tables represented with two arrays names and columns, where names[i] is the name of the ith table and columns[i] is the number of colu ......
leetcode-1518-easy
Water Bottles ``` There are numBottles water bottles that are initially full of water. You can exchange numExchange empty water bottles from the marke ......
stm32定时器外部计数模式 最大频率计算。
外部时钟模式下,外部信号通过内部时钟(CK_INT)采样得到。 外部信号周期的计算方法是:2xTINT+20ns,这里的TINT是CK_INT的周期时间。 例如:内部时钟频率为72MHz,则TINT = 13.89ns,这时外部信号的最高频率是:1/(2x13.89ns+20ns) = 20.93M ......
使用 STM32 测量频率和占空比的几种方法
这几天在论坛上面解答了好几个询问STM32测量频率的贴子,觉得这种需求还是存在的(示波器、电机控制等等)。而简单搜索了一下论坛,这方面的贴子有但是不全。正好今年参加比赛做过这方面的题目(最后是一等奖嘿嘿),所以把我们当时尝试过的各种方案都列出来,方便以后大家使用,也是作为一个长期在论坛的潜水党对论坛 ......
Codility / LeetCode的重要性与注意事项
Codility / Leetcode 不只会针对回答内容给出最终分数,也会一并记录解题的过程供面试官参考; 相较于现场考试,Codility / Leetcode可以省下更多时间,也能让求职者在最熟悉的环境发挥实力。 进行测验前 先查看Codility / Leetcode FAQ,并完成demo ......
[LeetCode] 2268. Minimum Number of Keypresses
You have a keypad with 9 buttons, numbered from 1 to 9, each mapped to lowercase English letters. You can choose which characters each button is match ......
[LeetCode] 2323. Find Minimum Time to Finish All Jobs II
You are given two 0-indexed integer arrays jobs and workers of equal length, where jobs[i] is the amount of time needed to complete the ith job, and w ......
[LeetCode] 2330. Valid Palindrome IV
You are given a 0-indexed string s consisting of only lowercase English letters. In one operation, you can change any character of s to any other char ......
[LeetCode] 2340. Minimum Adjacent Swaps to Make a Valid Array
You are given a 0-indexed integer array nums. Swaps of adjacent elements are able to be performed on nums. A valid array meets the following condition ......
[LeetCode] 2422. Merge Operations to Turn Array Into a Palindrome
You are given an array nums consisting of positive integers. You can perform the following operation on the array any number of times: Choose any two ......
[LeetCode] 1676. Lowest Common Ancestor of a Binary Tree IV
Given the root of a binary tree and an array of TreeNode objects nodes, return the lowest common ancestor (LCA) of all the nodes in nodes. All the nod ......
LeetCode之0661, 二维向量初始化
img[i][j]周围的单元格,img[i+i1][j+j1], i1=-1,0,1, j1=-1,0,1, 每个都判断一次。O(9*m*n) class Solution { public: std::vector<std::vector<int>> imageSmoother( std::vec ......
Leetcode之0709, 修改字符串
1 class Solution { 2 public: 3 string toLowerCase(string s) { 4 for(char &ch: s){ 5 if(ch>='A' && ch<='Z'){ 6 ch=tolower(ch); 7 } 8 } 9 return s; 10 } ......
[LeetCode] 2486. Append Characters to String to Make Subsequence
You are given two strings s and t consisting of only lowercase English letters. Return the minimum number of characters that need to be appended to th ......
[刷题记录Day4]Leetcode链表专题
# No.1 ## 题目 [两两交换链表中的节点](https://leetcode.cn/problems/swap-nodes-in-pairs/) ## 思路 - 模拟类型题目 - 两个节点前后交换,同时记住原来的下一个节点 - 虚拟头节点 ## 代码 ```Java public ListN ......