/images/avatar.jpg

草祭の博客

Hugo博客侧边导航栏

感觉博客TOC(侧边导航栏,Table of Content)还是挺有必要的,在LeaveIt主题issue有人谈到TOC,但是我实践了一遍好像不太行,所以我自己又另找了方法, 需要说明的是我并没有系统学过前端开发,所以可能会有疏漏的地方,不过从结果上来看是能用的。

每日Leetcode02

35. Search Insert Position

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.

每日Leetcode01

从今天起开始做每日LeetCode这个系列,从array, string, tree, linkedlist, math标签里选题做。

189. Rotate Array

tag. array
Solution来源 :https://leetcode.com/problems/rotate-array/discuss/54426/Summary-of-solutions-in-Python

Hugo博客代码高亮

在写LaTeX的时候,感觉个人博客的代码高亮很有问题,在不该高亮的地方高亮,所以想解决一下这个问题。

方法一. 使用Hugo扩展包

其实关于代码高亮,如果是使用LeaveIt主题的话,在issue里面有人提出过,解决方案主要是使用Hugo的extented包中对Sass/SCSS的支持。