leetcode位置35

LeetCode60. 排列序列

class Solution { public: int fac[10]; void init() { fac[0]=1; fac[1]=1; for(int i=2;i<10;i++) fac[i]=fac[i-1]*i; return; } string str; bool visited[10 ......
序列 LeetCode 60

代码随想录Day10-Leetcode232. 用栈实现队列,225. 用队列实现栈

### 232.用栈实现队列 尽管是很简单的一题, 但还是参考了题解, 一开始还在想,push的时候还得把输出栈倒回来效率好低 结果一看题解发现不用 //思路: 对对队列尾部操作时(push,empty), 对输入栈正常操作; 对队列头部操作时(peek,pop),全部弹出到输出栈中操作 //参考思 ......
队列 随想录 随想 Leetcode 代码

【LeetCode动态规划#03】整数拆分(数学题)

整数拆分 力扣题目链接(opens new window) 给定一个正整数 n,将其拆分为至少两个正整数的和,并使这些整数的乘积最大化。 返回你可以获得的最大乘积。 示例 1: 输入: 2 输出: 1 解释: 2 = 1 + 1, 1 × 1 = 1。 示例 2: 输入: 10 输出: 36 解释: ......
数学题 整数 LeetCode 数学 动态

代码随想录Day9-Leetcode28. 实现 strStr(),459.重复的子字符串

28. 实现 strStr() 这题之前写过, 而且印象深刻的是细节很多,所以这边是看完以前的代码,再写的(几乎是在背代码了hhh) 甚至这样, next[0]=-1, 和j开始匹配子串是没初始化成0这样的细节还是忘了 手撕kmp感觉光靠理解是有困难的 /** * @param {string} h ......

滚动到指定位置

//滚动到选中定位的位置 selectedRegion() { // 通过Id获取到对应的dom元素 const node = document.getElementById(this.sertCurrnetKey) setTimeout(() => { if (node) { this.$next ......
位置

代码随想录Day8-Leetcode344.反转字符串 II,541. 反转字符串II ,剑指Offer 05.替换空格 ,151.翻转字符串里的单词,剑指Offer58-II.左旋转字符串

344. 反转字符串 题目链接:https://leetcode.cn/problems/reverse-string 明显的双指针 /** * @param {character[]} s * @return {void} Do not return anything, modify s in-p ......
字符串 字符 随想录 左旋 Offer

SpringBoot - 多环境配置及配置文件位置

配置文件位置 file:./config/ file:./ classpath:/config/ classpath:/(默认配置文件位置) 优先级依次:1 > 2 > 3 > 4 properties格式文件,选择激活配置文件 新建配置文件 配置application-test.propertie ......
SpringBoot 位置 环境 文件

[LeetCode] 1032. Stream of Characters

Design an algorithm that accepts a stream of characters and checks if a suffix of these characters is a string of a given array of strings words. For ......
Characters LeetCode Stream 1032 of

LeetCode——45. 跳跃游戏 II

LeetCode链接 45. 跳跃游戏 II 给定一个长度为 n 的 0 索引整数数组 nums。初始位置为 nums[0]。 每个元素 nums[i] 表示从索引 i 向前跳转的最大长度。换句话说,如果你在 nums[i] 处,你可以跳转到任意 nums[i + j] 处: 0 <= j <= n ......
LeetCode 45 II

PID再学习---从公式理解到实际应用+实际手搓位置式pid和增量式pid

本来前一周还在做Kalman Filter的mpu6050实战,但是出于各种原因耽搁了,这周又碰上调试任务和各种作业,到现在才腾出点空总结一下这周的学习。(顺便吐槽一下,运筹学作业害的昨天两点睡的觉,悲) 其实平常的代码中一直都在用pid,但是最近用的时候才发现自己很多地方理解不够,出现了比较多的问 ......
实际 增量 公式 pid 位置

【LeetCode动态规划#02】图解不同路径I + II(首次涉及二维dp数组,)

不同路径 力扣题目链接(opens new window) 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为 “Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为 “Finish” )。 问总共有多少条不同的路径? 示例 1: 输入 ......
数组 路径 LeetCode 动态 02

LeetCode28. 找出字符串中第一个匹配项的下标

题目描述: 给你两个字符串 haystack 和 needle ,请你在 haystack 字符串中找出 needle 字符串的第一个匹配项的下标(下标从 0 开始)。 如果 needle 不是 haystack 的一部分,则返回 -1 。 示例 1: 输入:haystack = "sadbutsa ......
下标 字符串 字符 LeetCode 28

leetcode-1480-easy

Running Sum of 1d Array Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nu ......
leetcode 1480 easy

leetcode-1450-easy

Number of Students Doing Homework at Given Time Given two integer arrays startTime and endTime and given an integer queryTime. The ith student started ......
leetcode 1450 easy

leetcode-1437-easy

Check If All 1's Are at Least Length K Places Away Given an binary array nums and an integer k, return true if all 1's are at least k places away from ......
leetcode 1437 easy

leetcode-1317-easy

Find the Distance Value Between Two Arrays Given two integer arrays arr1 and arr2, and the integer d, return the distance value between the two arrays ......
leetcode 1317 easy

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

三角形中最小路径之和 1.题目描述 给定一个三角形 triangle ,找出自顶向下的最小路径和。 每一步只能移动到下一行中相邻的结点上。相邻的结点 在这里指的是 下标 与 上一层结点下标 相同或者等于 上一层结点下标 + 1 的两个结点。也就是说,如果正位于当前行的下标 i ,那么下一步可以移动到 ......
专项 Leetcode offer

Leetcode Practice -- 字符串

14. 最长公共前缀 编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀,返回空字符串 ""。 输入:strs = ["flower","flow","flight"] 输出:"fl" 思路解析 string longestCommonPrefix(vector<string>& s ......
字符串 字符 Leetcode Practice

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

路径的数目 题目: 一个机器人位于一个 m x n 网格的左上角 (起始点在下图中标记为 “Start” )。 机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角(在下图中标记为 “Finish” )。 问总共有多少条不同的路径 链接 思路: 这是一道基础的DP题目,走到位置(1,1)只 ......
专项 Leetcode offer

WebApi控制器方法接受参数的位置

FromBody //application/json FromForm //前端的默认消息类型 FromHeader //从请求头里获取 FromQuery //从Url路径中提取 FromRoute //从路由中获取 FromServices //这个Jwt篇讲解 ......
控制器 位置 参数 方法 WebApi

LeetCode45. 跳跃游戏 II

class Solution { public: //f[i]表示跳到i所需的最小步数 int jump(vector<int>& nums) { vector<int> f(10010,0x3f3f3f3f); int n=nums.size(); f[0]=0; for(int i=0;i<n; ......
LeetCode 45 II

LeetCode 55. 跳跃游戏

class Solution { public: //f[i]表示下标i是否能跳到 static const int N=3e4+10; bool canJump(vector<int>& nums) { int n=nums.size(); for(int i=0,j=0;i<n;i++)//j记 ......
LeetCode 55

【LeetCode动态规划#01】动规入门:求斐波那契数 + 爬楼梯(熟悉解题方法论)

斐波那契数 力扣题目链接(opens new window) 斐波那契数,通常用 F(n) 表示,形成的序列称为 斐波那契数列 。该数列由 0 和 1 开始,后面的每一项数字都是前面两项数字的和。也就是: F(0) = 0,F(1) = 1 F(n) = F(n - 1) + F(n - 2),其中 ......
方法论 楼梯 LeetCode 方法 动态

LeetCode151. 反转字符串中的单词

题目描述: 给你一个字符串 s ,请你反转字符串中 单词 的顺序。 单词 是由非空格字符组成的字符串。s 中使用至少一个空格将字符串中的 单词 分隔开。 返回 单词 顺序颠倒且 单词 之间用单个空格连接的结果字符串。 注意:输入字符串 s中可能会存在前导空格、尾随空格或者单词间的多个空格。返回的结果 ......
字符串 单词 字符 LeetCode 151

LeetCode 169. 多数元素(/hash sort 随机化 分治 Boyer-Moore 投票算法)

原题解 ###题目 约束 ###题解 ####方法一:哈希表 class Solution { public: int majorityElement(vector<int>& nums) { unordered_map<int, int> counts; int majority = 0, cnt ......
算法 Boyer-Moore LeetCode 元素 Boyer

LeetCode剑指 Offer 05. 替换空格

题目描述: 请实现一个函数,把字符串 s 中的每个空格替换成"%20"。 示例 1: 输入:s = "We are happy."输出:"We%20are%20happy." 限制: 0 <= s 的长度 <= 10000 //使用一个新的对象,复制 str,复制的过程对其判断,是空格则替换,否则直 ......
空格 LeetCode Offer 05

ggplot2中修改图例的位置

001、默认绘图 bp <- ggplot(PlantGrowth, aes(x=group, y=weight, fill=group)) + geom_boxplot() ## 绘图 bp ## 输出图片 002、上部 bp + theme(legend.position="top") ## 放 ......
位置 ggplot2 ggplot

代码随想录Day7-Leetcode454. 四数相加 II,383. 赎金信 ,15. 三数之和 ,18. 四数之和

### 454. 四数相加 II 这个第一时间没想出来怎么做的; 后面看了题解才发现可以两两分组;绝了 /** * @param {number[]} nums1 * @param {number[]} nums2 * @param {number[]} nums3 * @param {number ......

Element UI中的.babelrc的位置及替换内容解析

Element UI中的.babelrc的位置及替换内容解析 路径:[自定义的文件名]\node_modules\babel-plugin-dynamic-import-node\.babelrc 然后把以下内容: { "presets": [ "airbnb" ], "plugins": [ "a ......
位置 Element babelrc 内容

LeetCode541. 反转字符串 II

题目描述: 给定一个字符串 s 和一个整数 k,从字符串开头算起,每计数至 2k 个字符,就反转这 2k 字符中的前 k 个字符。 如果剩余字符少于 k 个,则将剩余字符全部反转。如果剩余字符小于 2k 但大于或等于 k 个,则反转前 k 个字符,其余字符保持原样。 示例 1: 输入:s = "ab ......
字符串 字符 LeetCode 541 II