haruhiui
Starlight

haruhiui

= 約束タワーで待ってて =

Trie

# Trie 前缀树。 借鉴自 宫水三叶 大佬的 [【设计数据结构】实现 Trie (前缀树)](https://mp.weixin.qq.com/s?__biz=MzU4NDE3MTEyMA==&mid=2247488490&idx=1&sn=db2998cb0e5f08684ee1b6009b974089&chksm=fd9cb8f5caeb31e3f7f67dba981d8d01a24e26c93ead5491edb521c988adc0798d8acb6f9e9d&token=1006889101&lang=zh_CN#rd)。 Trie 树(又叫「前缀树」或「字典树」)是一种用于
more...

Linked List

Linked List 链表。 面试时要是有链表相关题目,需要问清楚是单链表还是双链表、有没有可能有环。 # 亿点点练习题 ## [206. Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) 最基础的反转链表。 ```python lc206-1.py # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val =
more...

Other

# 博弈论 [292. Nim 游戏](https://leetcode-cn.com/problems/nim-game/) 只要 n 不能被 4 整除即可。 ```python lc292-1.py class Solution: def canWinNim(self, n: int) -> bool: return n % 4 != 0 ``` [810. 黑板异或游戏](https://leetcode-cn.com/problems/chalkboard-xor-game/) > 说到异或我想到之前面试时面试官问的一道题,这里顺便说一下:一个数
more...

DFS

## 练习 ### [37. 解数独](https://leetcode-cn.com/problems/sudoku-solver/) ```python lc37-1.py class Solution: def solveSudoku(self, board: List[List[str]]) -> None: """ Do not return anything, modify board in-place instead. """ rows = [[False] * 9 for _ in range(9)]
more...

Binary Search

## 不同的写法 为什么要研究几种不同的写法?说到底只是闲的无聊罢了。 ### 写法一 翻译自 [Variants of Binary Search](https://www.geeksforgeeks.org/variants-of-binary-search/) 。 ```python binary_search_1.py def contains(nums, low, high, key): ans = False while low <= high: mid = (low + high) // 2 if nums[mid
more...