hexo butterfly让TOC生效
安装插件
加入目录
习惯typora的TOC,发现hexo butterfly的侧边栏不太一样,这里没有,新加一个插件
安装插件1npm install hexo-toc --save
加入目录带展开的,在每篇文章开头加上
1<!-- more --><!-- toc -->
leetcode小抄:14. Longest Common Prefix]
solution 1 笨蛋方法
核心思路
复杂度分析
字符串切片
基本用法
负索引
示例
solution 2 聪明方法
核心思路
zip用法
语法
功能
示例
复杂度分析
Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string "".
Example 1:
Input: strs = [“flower”,”flow”,”flight”]Output: “fl”
Example 2:
Input: strs = [“dog”,”racecar”,”car”]Output: “”Explanation: There is no common prefix among the input strings.
Constraints:
1 <= strs.length <= 200
0 <= strs[i]. ...
leetcode小抄:9. Palindrome Number
solution 1 笨蛋方法
solution 2 聪明方法
exploration 不转换成字符串
关键句
核心思路
“level”、“radar”、“Kayak”、“Madam”、“Racecar”、“Noon”和“12321”都是回文
Palindrome Number Given an integer x, return true if x is a palindrome, and false otherwise.
Example 1:
Input: x = 121Output: trueExplanation: 121 reads as 121 from left to right and from right to left.Example 2:
Input: x = -121Output: falseExplanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.Example 3: ...
leetcode小抄:1. Two Sum
solution 1 笨蛋方法
时间复杂度 (Time Complexity)
空间复杂度 (Space Complexity)
solution 2 聪明方法
exploration 如果有多对解
exploration 复杂度
时间复杂度
空间复杂度
果然two sum就是cs界的abandon
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
You can return the answer in any order.
Example 1:
Input: nums = [2,7,11,15], target = 9Output: [0,1]Explanati ...
hexo butterfly更换思源字体
创建font文件夹
创建css
编辑D:\nodejs\hexo\themes\butterfly\_config.butterfly.yml
没有思源字体我要死了,其他字体的中文真的巨丑
创建font文件夹在themes/butterfly/source/下创建font文件夹
将SourceHanSerifCN-Regular.ttf和SourceHanSerifCN-Normal.ttf放进font
创建css在themes/butterfly/source/css/下创建font.css
编辑font.css
123456789@font-face{ font-family: 'Source Han Serif SC'; font-display: swap; src: url('../font/SourceHanSerifCN-Regular.ttf') format("truetype");}body { font-family: 'Noto ...
leetcode小抄:13. Roman to Integer
solution 1 笨蛋方法
solution 2 笨蛋方法优化版
solution 3 聪明方法
核心思路
1. 逆序遍历(从右到左)
2. 累积求和与减法规则的隐式应用
3. 代码中的实现
特例处理也通过:49 = “XLIX”
时空复杂度
Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.
Symbol ValueI 1V 5X 10L 50C 100D 500M 1000
For example, 2 is written as II in Roman numeral, just two ones added together. 12 is written as XII, which is simply X + II. The number 27 is written as ...
【APS临时抱佛脚】计算机网络-英文版大纲
This course covers the fundamental concepts and technologies behind computer networks. It explains the layered architecture, starting from the physical layer that deals with transmitting raw data, up to the application layer protocols that enable services like the web, email, and file transfer. Key areas include data link protocols for reliable communication, the Internet Protocol and routing principles that form the network infrastructure, and transport protocols like TCP that enable end-to-end ...
hexo部署完博客查看google是否收录github pages
参考文档来自
让google收录github pages(hexo) | 珠 (huanglizhu.github.io)
确定是否被收录去google输入网址http://oushiro.xyz
如果是Google Search Console,则意味着没有被收录
点开Google Search Console顺其自然登陆一网通(。有两个选择,网域和网域前缀,选择前缀验证
下载html文件放到指定位置这里下载没有问题,但是大佬是这样操作的,多了一步修改html文件,我试了一下验证没有通过,最后是重新放了一个没修改的html文件过去就通过了比如下载的文件叫做google233.html,我先根据下面的修改了放到D:\nodejs\hexo\source下,验证失败,我再把原文件拖到相同目录比如文件叫google233(1).html,验证通过了
修改HTML文件注意!!:为了使 hexo 不处理这个HTML验证文件,并且不生成关于这个文件的 sitemap,我们需要打开验证文件,在最上面添加以下代码,总共3行最后一行是空行需保留
1234layout: false---
hexo butterfly美化之换背景和页脚
页脚写css在路径D:\nodejs\hexo\themes\butterfly\source\css下新建一个文件background.css
1234567891011121314/* footer样式 */#footer { background: #fff; /* background: #fff url("/images/footer.jpg"); */ /* opacity: 0.3; */}#footer-wrap { padding: 20px 20px; /* color: var(--light-grey); */ color: #000;}#footer-wrap a{ color: #49b1f5;}
背景写css在D:\nodejs\hexo\themes\butterfly\source\css下新建一个background.css
123456#web_bg { background-image: url("http ...
hexo butterfly美化之字数统计
引入字数统计相关插件1npm install hexo-wordcount --save
修改配置文件改的是路径D:\nodejs\hexo下的_config.butterfly.yml
1234567# wordcount (字數統計)# see https://butterfly.js.org/posts/ceeb73f/#字數統計wordcount: enable: true post_wordcount: true min2read: true total_wordcount: true