Hugo博客侧边导航栏
感觉博客TOC(侧边导航栏,Table of Content)还是挺有必要的,在LeaveIt主题issue有人谈到TOC,但是我实践了一遍好像不太行,所以我自己又另找了方法, 需要说明的是我并没有系统学过前端开发,所以可能会有疏漏的地方,不过从结果上来看是能用的。
感觉博客TOC(侧边导航栏,Table of Content)还是挺有必要的,在LeaveIt主题issue有人谈到TOC,但是我实践了一遍好像不太行,所以我自己又另找了方法, 需要说明的是我并没有系统学过前端开发,所以可能会有疏漏的地方,不过从结果上来看是能用的。
tags. Array
向有序列表里找到需要插入值的index,且You may assume no duplicates in the array.
Example 1:
Input: [1,3,5,6], 5
Output: 2我的Solution:
class Solution:
def searchInsert(self, nums: List[int], target: int) -> int:
for i in range(len(nums)):
if nums[i]>=target:
return i
return len(nums)Runtime: 64 ms, faster than 22.39% of Python3 online submissions for Search Insert Position.
从今天起开始做每日LeetCode这个系列,从array, string, tree, linkedlist, math标签里选题做。
tag. array
Solution来源 :https://leetcode.com/problems/rotate-array/discuss/54426/Summary-of-solutions-in-Python
在写LaTeX的时候,感觉个人博客的代码高亮很有问题,在不该高亮的地方高亮,所以想解决一下这个问题。
其实关于代码高亮,如果是使用LeaveIt主题的话,在issue里面有人提出过,解决方案主要是使用Hugo的extented包中对Sass/SCSS的支持。