leetcode anagrams string find

leetcode71. 简化路径

class Solution: def simplifyPath(self, path: str) -> str: li=path.split("/") res=[] for i in li: if i=='..' and res: res.pop() if i!='.' and i!='..' a ......
路径 leetcode 71

算法训练day10 LeetCode 232

算法训练day10: LeetCode 232.225. 232.用栈实现队列 题目 232. 用栈实现队列 - 力扣(LeetCode) 题解 代码随想录 (programmercarl.com) class MyQueue { public: stack<int> stIn; stack<int ......
算法 LeetCode day 232 10

leetcode 加油站——一次遍历

class Solution: def canCompleteCircuit(self, gas: List[int], cost: List[int]) -> int: n=len(gas) max_gas=0 rest=0 records=[] start=0 for i in range(n) ......
加油站 leetcode

【LeetCode】删除数对后的最小数组长度

题目 给你一个下标从 0 开始的 非递减 整数数组 nums 。 你可以执行以下操作任意次: 选择 两个 下标 i 和 j ,满足 i < j 且 nums[i] < nums[j] 。 将 nums 中下标在 i 和 j 处的元素删除。剩余元素按照原来的顺序组成新的数组,下标也重新从 0 开始编号 ......
数组 长度 LeetCode

【java基础】String转byte Byte转String 【一眼就会系列】

byte就是字节码数组。 (为啥我要说基础知识?因看不惯讲基础的某些文说一堆,不说重点。) ......
String 基础 java Byte byte

leetcode 二叉树的最小深度

给定一个二叉树,找出其最小深度。 最小深度是从根节点到最近叶子节点的最短路径上的节点数量。 说明:叶子节点是指没有子节点的节点。 示例 1: 输入:root = [3,9,20,null,null,15,7] 输出:2 示例 2: 输入:root = [2,null,3,null,4,null,5, ......
深度 leetcode

leetcode 平衡二叉树

给定一个二叉树,判断它是否是高度平衡的二叉树。 本题中,一棵高度平衡二叉树定义为: 一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1 。 示例 1: 输入:root = [3,9,20,null,null,15,7] 输出:true 示例 2: 输入:root = [1,2,2,3,3, ......
leetcode

【ERROR: Could not find a version that satisfies】【ERROR: No matching distribution found for】【ERROR: Could not install packages due to an OSError:】

pip包安装出错 真是把我烦死了,在yt上学东西,结果一直出这样的错,之前我都是把包下载到本地安装的,这也不是长久之计。 然后我试了使用 -i,使用--trusted-host,使用--user,使用--upgrade pip...全都不管用。 后来我想,究竟是什么时候出现这个问题的,好像很久之前就 ......
ERROR Could distribution not satisfies

WebStrom提交代码到GitLab报错Error: Cannot find any-observable implementation nor global.Observable.

项目场景: 前端代码完成后,提交代码 问题描述 提交代码到GitLab时,因自动检测机制导致项目提交失败 C:\D\insper\inspur_works\custom-manage-front\node_modules\any-observable\register.js:29 throw new ......

[LeetCode] 1222. Queens That Can Attack the King

On a 0-indexed 8 x 8 chessboard, there can be multiple black queens ad one white king. You are given a 2D integer array queens where queens[i] = [xQue ......
LeetCode Attack Queens 1222 King

[LeetCode] 2596. Check Knight Tour Configuration

There is a knight on an n x n chessboard. In a valid configuration, the knight starts at the top-left cell of the board and visits every cell on the b ......
Configuration LeetCode Knight Check 2596

LeetCode-Java题解 209. Minimum Size Subarray Sum

题目地址:209. Minimum Size Subarray Sum 解题思路: 看到这道题,心里本身是有双指针这个概念的,但是不知道怎么用,脑子里第一反应就是暴力解法,双for一把梭,然后时间就超时了...看了题解才知道滑动窗口这个解法,不禁直呼妙啊!感觉和双指针非常类似,其核心点在于避免了暴力 ......

CF914F Substrings in a String

知识点:bitset,SAM,根号分治 Link:https://codeforces.com/problemset/problem/914/F 一种在字符集较小情况下的多轮字符串匹配暴力的优化。 好久没写过单题的题解了格式都忘了、、、 简述 给定一仅包含小写字母的字符串 \(s\),给定 \(q\ ......
Substrings String 914F 914 CF

leetcode1466

分析: 它是有n个节点,n-1条边 所以两个节点连接的边只有一条,那么要么是可以从这条边的起点开始能够到达0,要么是不能,不会有回路的情况 对于数据结构使用哈希表值为vector容器 int bfs(vector<vector<int>>& connections){ unordered_map<i ......
leetcode 1466

linux 中 readlink、realpath、find输出软链接文件绝对路径的差异

001、 [root@pc1 test1]# ls ## 三个测试文件 a.txt b.txt testfile [root@pc1 test1]# ll -h total 4.0K lrwxrwxrwx. 1 root root 20 Sep 16 12:03 a.txt -> /home/tes ......
路径 readlink realpath 差异 链接

linux 中 find命令查找输出文件的绝对路径

001、 [root@pc1 test1]# ls ## 测试文件 a.txt a.TXT c.csv c.tXt d.txt e.Txt f.csv k.map [root@pc1 test1]# find ./ -name "*.txt" ## 显示相对路径 ./a.txt ./d.txt [r ......
路径 命令 文件 linux find

linux 中 find命令忽略大小写查找文件

001、 -iname选项 实现忽略大小写查找 [root@pc1 test1]# ls ## 测试文件 a.txt a.TXT c.csv c.tXt d.txt e.Txt f.csv k.map [root@pc1 test1]# find ./ -name "*.txt" ## 一般查找 . ......
命令 大小 文件 linux find

【面试题精讲】你了解String.intern方法吗

有的时候博客内容会有变动,首发博客是最新的,其他博客地址可能会未同步,认准https://blog.zysicyj.top 首发博客地址 系列文章地址 String.intern 方法是 Java 中的一个方法,它用于将字符串对象添加到字符串常量池中,并返回常量池中该字符串的引用。如果常量池中已经存 ......
方法 String intern

【Leetcode】解题报告Day3~Day4

解题报告 Day3 1. 66. 加一 给定一个由 整数 组成的 非空 数组所表示的非负整数,在该数的基础上加一。 最高位数字存放在数组的首位, 数组中每个元素只存储单个数字。 你可以假设除了整数 0 之外,这个整数不会以零开头。 示例 1: 输入:digits = [1,2,3] 输出:[1,2, ......
Day Leetcode 报告 Day3 Day4

leetcode 将有序数组转换为二叉搜索树

给你一个整数数组 nums ,其中元素已经按 升序 排列,请你将其转换为一棵 高度平衡 二叉搜索树。 高度平衡 二叉树是一棵满足「每个节点的左右两个子树的高度差的绝对值不超过 1 」的二叉树。 示例 1: 输入:nums = [-10,-3,0,5,9] 输出:[0,-3,9,-10,null,5] ......
数组 leetcode

[LeetCode] 1352. Product of the Last K Numbers 最后 K 个数的乘积

Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream. Implement the ProductOfNumbers c ......
乘积 个数 LeetCode Product Numbers

Leetcode 1193. 每月交易Ⅰ

1193. 每月交易Ⅰ 题目 表:Transactions + + + | Column Name | Type | + + + | id | int | | country | varchar | | state | enum | | amount | int | | trans_date | d ......
Leetcode 1193

LocalDate、LocalDateTime的用法与String互转

一、LocalDate常用用法 1.1、申明定义 LocalDate formatDate = LocalDate.of(2020, 2, 5); // 自定义 LocalDate today = LocalDate.now(); // 获取当前日期 1.2、getX() 获取年月日等 注意:获取月 ......
LocalDateTime LocalDate String

String与StringBuffer

string与stringbuffer都是通过字符数组实现的。 其中string的字符数组是final修饰的,所以字符数组不可以修改。 stringbuffer的字符数组没有final修饰,所以字符数组可以修改。 string与stringbuffer都是final修饰,只是限制他们所存储的引用地址 ......
StringBuffer String

[LeetCode] 85. Maximal Rectangle_Hard tag: Dynamic Programming

Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example 1: Input: matri ......

【深入解读Redis系列】(五)Redis中String的认知误区,详解String数据类型

有时候博客内容会有变动,首发博客是最新的,其他博客地址可能会未同步,请认准https://blog.zysicyj.top 首发博客地址 系列文章地址 需求描述 现在假设有这样一个需求,我们要开发一个图像存储系统。要求如下: 该系统能快速记录图片的ID和图片保存在系统中的ID 能根据图片ID快速查找 ......
String Redis 误区 类型 数据

leetcode 二叉树的最大深度

给定一个二叉树 root ,返回其最大深度。 二叉树的 最大深度 是指从根节点到最远叶子节点的最长路径上的节点数。 示例 1: 输入:root = [3,9,20,null,null,15,7] 输出:3 示例 2: 输入:root = [1,null,2] 输出:2 解题思路 这里可以转化思路为 ......
深度 leetcode

利用find命令按照创建、修改时间删除文件

使用touch命令修改文件访问时间和修改时间: touch -t 202301011200 Example.txt 删除三十天前创建的时间 find /path/to/dir -type f -ctime +5 -delete 目前还不确定如何修改文件创建时间,但是可以利用上述find语句删除修改时 ......
命令 文件 时间 find

Leetcode(Hash)

1.the sum of two nums 1.1Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. 1.2 ......
Leetcode Hash

查看子文件夹中的文件个数及find命令解析

查看子文件夹中的文件个数 find /home/test -type f -printf '%h\n' | sort | uniq -c /home/test 要查找的目录 -type 按文件类型查找 f:指普通文件 d:目录文件 -printf 打印输出 %h 文件目录 \n 新行 sort 排序 ......
文件 文件夹 个数 命令 find