leetcode 454 ii
leetcode-1337-easy
The K Weakest Rows in a Matrix You are given an m x n binary matrix mat of 1's (representing soldiers) and 0's (representing civilians). The soldiers ......
leetcode-1342-easy
Number of Steps to Reduce a Number to Zero Given an integer num, return the number of steps to reduce it to zero. In one step, if the current number i ......
leetcode-1360-easy
Number of Days Between Two Dates Write a program to count the number of days between two dates. The two dates are given as strings, their format is YY ......
leetcode-766-easy
Toeplitz Matrix Given an m x n matrix, return true if the matrix is Toeplitz. Otherwise, return false. A matrix is Toeplitz if every diagonal from top ......
leetcode-806-easy
Number of Lines To Write String You are given a string s of lowercase English letters and an array widths denoting how many pixels wide each lowercase ......
leetcode-812-easy
Largest Triangle Area Given an array of points on the X-Y plane points where points[i] = [xi, yi], return the area of the largest triangle that can be ......
leetcode-830-easy
Positions of Large Groups In a string s of lowercase letters, these letters form consecutive groups of the same character. For example, a string like ......
leetcode-844-easy
Backspace String Compare Given two strings s and t, return true if they are equal when both are typed into empty text editors. '#' means a backspace c ......
leetcode-944-easy
Delete Columns To Make Sorted You are given an array of n strings strs, all of the same length. The strings can be arranged such that there is one on ......
代码随想录算法训练营Day01 | LeetCode704 二分查找、Leetcode27 移除元素
今日学习的视频和文章 代码随想录数组基础 复习基础知识 代码随想录 二分查找 代码随想录 移除元素 LeetCode704 二分查找 题目链接:704. 二分查找 - 力扣(Leetcode) 以前学二分查找的时候,真的一直搞不清楚怎么操作左边界和有边界,以及循环的终止条件是什么,总是自己慢慢调试出 ......
leetcode_打卡04
leetcode_打卡04 题目:605. 种花问题 解答: 三种情况: 第一个1的左边全是0的情况,此时 可以插入的位置为result=(i-1+1)/2 ,如【0,0,0,1,0,0,1】 两个1之间全是0的情况。此时 可以插入的位置为result=(i-flag-1-2+1)/2 第一个1的右 ......
LeetCode 周赛 340,质数 / 前缀和 / 极大化最小值 / 最短路 / 平衡二叉树
本文已收录到 AndroidFamily,技术和职场问题,请关注公众号 [彭旭锐] 提问。 大家好,我是小彭。 上周跟大家讲到小彭文章风格的问题,和一些朋友聊过以后,至少在算法题解方面确定了小彭的风格。虽然竞赛算法题的文章受众非常小,但却有很多像我一样的初学者,他们有兴趣参加但容易被题目难度和大神选 ......
(动态规划)剑指 Offer 14- II. 剪绳子 II
题目描述: 给你一根长度为 n 的绳子,请把绳子剪成整数长度的 m 段(m、n都是整数,n>1并且m>1),每段绳子的长度记为 k[0],k[1]...k[m - 1] 。 请问 k[0]*k[1]*...*k[m - 1] 可能的最大乘积是多少?例如,当绳子的长度是8时,我们把它剪成长度分别为2、 ......
LeetCode习题——有效的完全平方数(二分查找)
有效的完全平方数 力扣链接:367. 有效的完全平方数 题目 给你一个正整数 num 。如果 num 是一个完全平方数,则返回 true ,否则返回 false 。 完全平方数是一个可以写成某个整数的平方的整数。换句话说,它可以写成某个整数和自身的乘积。 不能使用任何内置的库函数,如 sqrt 。 ......
[LeetCode] 1440. Jump Game V 跳跃游戏之五
Given an array of integers arr and an integer d. In one step you can jump from index i to index: i + x where: i + x < arr.length and 0 < x <= d. i - x ......
【前缀和】LeetCode 1031. 两个非重叠子数组的最大和
题目链接 1031. 两个非重叠子数组的最大和 思路 代码 class Solution { public int maxSumTwoNoOverlap(int[] nums, int firstLen, int secondLen) { // 求一个前缀和 for(int i = 1; i < n ......
【前缀和】LeetCode 1423. 可获得的最大点数
题目链接 1423. 可获得的最大点数 思路 通过逆向思维来考虑,因为我们是从两头拿数字,所以最终剩下的数字一定是位于中间的连续子数组。 因为数组总和不变,所以求两边数字加和的最大值,实际上就是求中间数字加和的最小值 代码 class Solution { public int maxScore(i ......
40. 组合总和 II
给定一个候选人编号的集合 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。 candidates 中的每个数字在每个组合中只能使用 一次 。 注意:解集不能包含重复的组合。 class Solution { private: ......
winform-C#操作IIS_DirectoryEntry
1、创建对象: DirectoryEntry rootfolder = new DirectoryEntry("IIS://localhost/W3SVC/1/ROOT"); // IIS://服务器的名字/要操作的Web服务器类型/站点/站点的虚拟目录 2、修改对象: 3、删除对象: 参考: C# ......
【DP】【分治】LeetCode 53. 最大子数组和
题目链接 [https://leetcode.cn/problems/maximum-subarray/description/](53. 最大子数组和 "https://leetcode.cn/problems/maximum-subarray/description/") 思路 分析动态规划题目 ......
剑指 Offer 09. 用两个栈实现队列 && leetcode225.用队列实现栈
剑指 Offer 09. 用两个栈实现队列 class CQueue { private: stack<int> inStack, outStack; void in2out(){ //这里必须是while循环,如果是if判断,则输出栈日常只有一个值,没有起到先入后出的作用 while(!inSta ......
day43 1049.最后一块石头的重量II |474.一和零494.目标和
有一堆石头,每块石头的重量都是正整数。 每一回合,从中选出任意两块石头,然后将它们一起粉碎。假设石头的重量分别为 x 和 y,且 x <= y。那么粉碎的可能结果如下: 如果 x == y,那么两块石头都会被完全粉碎; 如果 x != y,那么重量为 x 的石头将会完全粉碎,而重量为 y 的石头新重 ......
MATLAB代码:基于NSGA-II的水电-光伏多能互补协调优化调度
MATLAB代码:基于NSGA-II的水电-光伏多能互补协调优化调度 关键词:NSGA-II算法 多目标优化 水电-光伏多能互补 参考文档:《店主自写文档》基本复现; 仿真平台:MATLAB 主要内容:代码主要做的是基于NSGA-II的水电-光伏互补系统协调优化模型,首先,结合水电机组的运行原理以及 ......
LeetCode 109 有序链表转换二叉树
LeetCode 109.有序链表转换二叉搜索树 给定一个单链表的头节点 head ,其中的元素 按升序排序 ,将其转换为高度平衡的二叉搜索树。 本题中,一个高度平衡二叉树是指一个二叉树每个节点 的左右两个子树的高度差不超过 1。 示例 1: 输入: head = [-10,-3,0,5,9] 输出 ......
leetcode_打卡3
leetcode_打卡3 题目:1431. 拥有最多糖果的孩子 解答: class Solution { public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) { int max=0; int n=candies. ......
leetcode_打卡2
leetcode_打卡2 1071. 字符串的最大公因子 思路: 该题的答案一定是两个字符串的公共前缀,找到最大公共前缀,并且验证这个前缀能否被两个字符串除尽! class Solution { public String gcdOfStrings(String str1, String str2) ......
IIS 重定向
1.IIS没有URL重定向模块需要下载URL重新向模块 URL Rewrite 2.选择需要重定向的网站,URL重写=》右侧添加规则 4.双击选择空白规则 5.规则 6.配置完成后点击右侧的应用 本次重定向的目的: 将一个默认端口443的请求重定向到其他的特殊端口 本次的配置如下 其中(.*)表示重 ......
动态规划02——45. 跳跃游戏 II
45. 跳跃游戏 II 给定一个长度为 n 的 0 索引整数数组 nums。初始位置为 nums[0]。 每个元素 nums[i] 表示从索引 i 向前跳转的最大长度。换句话说,如果你在 nums[i] 处,你可以跳转到任意 nums[i + j] 处: 0 <= j <= nums[i] i + ......
【扫描线】LeetCode 218. 天际线问题
题目链接 218. 天际线问题 思路 参考宫水三叶大佬题解 代码 class Solution { public List<List<Integer>> getSkyline(int[][] buildings) { List<List<Integer>> result = new ArrayLis ......
Ethernet II Frame 协议格式
以太网帧有多种标准,每个标准有细微区别。最常见的是Ethernet II标准,除此之外还有Novell raw IEEE 802.3|IEEE 802.2 LLC|IEEE 802.2 SNAP。 帧头格式 |Dest MAC|Src MAC|Ethernet Type|Data|CRC| | | ......