mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-16 23:41:21 +08:00
docs: update
This commit is contained in:
48
src/content/post/日记/2024/11/2024-11-26.md
Normal file
48
src/content/post/日记/2024/11/2024-11-26.md
Normal file
@ -0,0 +1,48 @@
|
||||
---
|
||||
title: 2024-11-26
|
||||
date: 2024-11-26
|
||||
day_of_week: 星期二
|
||||
author: KazooTTT
|
||||
tags:
|
||||
- 日记
|
||||
- milklove
|
||||
- 幸福的具象化
|
||||
description:
|
||||
slug: 2024/11/2024-11-26
|
||||
published: true
|
||||
category: 日记-2024-11
|
||||
---
|
||||
|
||||
很幸福的一天,今天是milklove宣布二搭、三搭的日子。
|
||||
|
||||
6月入坑牛奶爱情,不知不觉嗑到现在,从没想过今天这样的发展。
|
||||
|
||||
在这里汇总一下今天的一些视频。
|
||||
|
||||
[截修](https://weibo.com/7101901680/P28tdryDc#comment)
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
[幸福的具象化](https://weibo.com/6083416567/P28jkx9MS#comment)
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
[girl rule cut](https://weibo.com/1750538651/P27NfAOja#comment)
|
||||
|
||||
[亲亲](https://weibo.com/1825971940/P288xfVxF#comment)
|
||||
|
||||

|
||||
|
||||
[二搭 预告片 婉司姬](https://weibo.com/1753015991/P27pq9oJU#comment)
|
||||
|
||||

|
||||
|
||||
[二搭 预告片 弯弯字幕组](https://weibo.com/7392264056/P27lQtUnd#comment)
|
||||
|
||||

|
@ -1,57 +0,0 @@
|
||||
---
|
||||
title: 141.环形链表
|
||||
date: 2023-09-12T00:00:00.000Z
|
||||
author: KazooTTT
|
||||
tags:
|
||||
- 算法
|
||||
- 链表
|
||||
- leetcode
|
||||
platform: leetcode
|
||||
number: 141
|
||||
url: 'https://leetcode.cn/problems/linked-list-cycle/'
|
||||
finished: true
|
||||
published: true
|
||||
slug: 141-ring-chained-tables
|
||||
description: >-
|
||||
该内容描述了一个用于检测链表中是否存在环的算法。算法通过使用两个指针,一个慢指针和一个快指针,在链表中移动。如果链表中存在环,快指针最终会追上慢指针;否则,快指针会先到达链表的末尾。算法首先检查链表的头节点是否为空或其下一个节点是否为空,如果是,则返回false,表示没有环。然后,算法进入一个循环,每次循环中慢指针前进一步,快指针前进两步。如果快指针变为null或其下一个节点为null,则返回false,表示没有环。如果循环中快指针与慢指针相遇,则返回true,表示链表中存在环。
|
||||
rinId: 58
|
||||
category: 编程-算法-记录
|
||||
---
|
||||
|
||||
# 141.环形链表
|
||||
|
||||
```ts
|
||||
/*
|
||||
* @lc app=leetcode.cn id=141 lang=typescript
|
||||
*
|
||||
* [141] 环形链表
|
||||
*/
|
||||
|
||||
// @lc code=start
|
||||
/**
|
||||
* Definition for singly-linked list.
|
||||
* class ListNode {
|
||||
* val: number
|
||||
* next: ListNode | null
|
||||
* constructor(val?: number, next?: ListNode | null) {
|
||||
* this.val = (val===undefined ? 0 : val)
|
||||
* this.next = (next===undefined ? null : next)
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
|
||||
function hasCycle(head: ListNode | null): boolean {
|
||||
if (head === null || head.next === null) return false
|
||||
let slow = head
|
||||
let fast = head.next
|
||||
while (slow !== fast) {
|
||||
if (fast === null || fast.next === null) return false
|
||||
slow = slow.next
|
||||
fast = fast.next.next
|
||||
}
|
||||
return true
|
||||
}
|
||||
// @lc code=end
|
||||
```
|
||||
|
||||

|
@ -1,17 +0,0 @@
|
||||
---
|
||||
title: 【leetcode】142.环形链表-ii
|
||||
date: 2023-09-13T00:00:00.000Z
|
||||
author: KazooTTT
|
||||
tags:
|
||||
- 算法
|
||||
platform: leetcode
|
||||
url: 'https://leetcode.cn/problems/linked-list-cycle-ii/description/'
|
||||
finished: true
|
||||
published: true
|
||||
slug: 142-ring-linked-tables-ii
|
||||
description: 题目“142.环形链表-ii”指的是一个关于数据结构中环形链表的问题,特别是针对环形链表中特定节点的查找或操作问题。
|
||||
rinId: 118
|
||||
category: 编程-算法-记录
|
||||
---
|
||||
|
||||
# 142.环形链表-ii
|
@ -1,32 +0,0 @@
|
||||
---
|
||||
description: >-
|
||||
内容中提到了两个编程问题及其相关注意事项。首先,对于“两数之和”问题,指出了在JavaScript代码中,如果`numberToIndexMap[targetNumber]`的值为0时,使用`!==
|
||||
undefined`进行判断可能会导致错误的结果,建议使用`in`操作符来检查对象属性是否存在。其次,提到了“删除有序数组中的重复项”问题,强调了需要原地删除重复元素,即不使用额外的空间。
|
||||
slug: 2024-03-05-brush-questions
|
||||
finished: true
|
||||
published: true
|
||||
date: '2024-07-11T02:17:53.454Z'
|
||||
rinId: 119
|
||||
category: 编程-算法-记录
|
||||
---
|
||||
|
||||
# 2024-03-05 刷题
|
||||
|
||||
需要注意的是
|
||||
|
||||
[1. 两数之和](https://leetcode.cn/problems/two-sum/)
|
||||
|
||||
```js
|
||||
if (numberToIndexMap[targetNumber] !== undefined) {
|
||||
const targetNumberIndex = numberToIndexMap[targetNumber]
|
||||
return [targetNumberIndex, i]
|
||||
}
|
||||
```
|
||||
|
||||
这里的写法,如果`numberToIndexMap[targetNumber] = 0` 的话, if也会判断为false,所以不能这么写。
|
||||
|
||||
要么写成`numberToIndexMap[targetNumber] !== undefined`要么写成 `if (targetNumber in numberToIndexMap)`
|
||||
|
||||
[26. 删除有序数组中的重复项](https://leetcode.cn/problems/remove-duplicates-from-sorted-array/)
|
||||
|
||||
请你 **[原地](http://baike.baidu.com/item/%E5%8E%9F%E5%9C%B0%E7%AE%97%E6%B3%95)** 删除重复出现的元素
|
@ -1,68 +0,0 @@
|
||||
---
|
||||
title: 【leetcode】86.分隔链表
|
||||
date: 2023-09-13T00:00:00.000Z
|
||||
author: KazooTTT
|
||||
tags:
|
||||
- 算法
|
||||
- 链表
|
||||
- leetcode
|
||||
- 待优化
|
||||
- todo
|
||||
platform: leetcode
|
||||
number: 86
|
||||
url: 'https://leetcode.cn/problems/partition-list/description/'
|
||||
finished: true
|
||||
published: true
|
||||
slug: 86-separated-chained-tables
|
||||
description: >-
|
||||
该内容描述了一个TypeScript函数`partition`,用于将一个单链表分割成两部分:一部分包含所有小于给定值x的节点,另一部分包含所有大于或等于x的节点。函数首先创建两个新的链表头节点`small`和`large`,分别用于存储小于x和大于等于x的节点。通过遍历原链表,将节点值小于x的节点添加到`small`链表,将节点值大于等于x的节点添加到`large`链表。最后,将`large`链表连接到`small`链表的尾部,并返回`small`链表的头节点。此方法在内存使用上还有优化空间。
|
||||
rinId: 59
|
||||
category: 编程-算法-记录
|
||||
---
|
||||
|
||||
# 86.分隔链表
|
||||
|
||||
```typescript
|
||||
/**
|
||||
* Definition for singly-linked list.
|
||||
* class ListNode {
|
||||
* val: number
|
||||
* next: ListNode | null
|
||||
* constructor(val?: number, next?: ListNode | null) {
|
||||
* this.val = (val===undefined ? 0 : val)
|
||||
* this.next = (next===undefined ? null : next)
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
|
||||
function partition(head: ListNode | null, x: number): ListNode | null {
|
||||
let small = new ListNode(-1),
|
||||
smallP = small,
|
||||
large = new ListNode(-1),
|
||||
largeP = large
|
||||
|
||||
while (head) {
|
||||
if (head.val < x) {
|
||||
smallP.next = {
|
||||
val: head.val,
|
||||
next: null,
|
||||
}
|
||||
smallP = smallP.next
|
||||
} else {
|
||||
largeP.next = {
|
||||
val: head.val,
|
||||
next: null,
|
||||
}
|
||||
largeP = largeP.next
|
||||
}
|
||||
head = head.next
|
||||
}
|
||||
largeP.next = null
|
||||
smallP.next = large.next
|
||||
return small.next
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
|
||||
可以看出内存还有很大的优化空间
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
slug: leetcode-brush-up
|
||||
published: true
|
||||
description: >-
|
||||
2023年1月10日,记录了在LeetCode上的刷题情况。首先完成了“两数之和”问题,随后解决了“删除有序数组中的重复项”,虽然使用的方法简单但性能较差。最后,解决了“移除元素”问题。每个问题都附有相关的提交链接和截图,以便记录和回顾。
|
||||
finished: true
|
||||
date: '2024-07-11T02:17:53.454Z'
|
||||
rinId: 120
|
||||
category: 编程-算法-记录
|
||||
---
|
||||
|
||||
# Leetcode刷题
|
||||
|
||||
2023-01-10
|
||||
[1. 两数之和 - 力扣(LeetCode)](https://leetcode.cn/problems/two-sum/submissions/394403223/)
|
||||
|
||||

|
||||
|
||||
[26. 删除有序数组中的重复项 - 力扣(LeetCode)](https://leetcode.cn/problems/remove-duplicates-from-sorted-array/submissions/394407635/)
|
||||
使用的方法比较简单,性能比较差
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
[27. 移除元素 - 力扣(LeetCode)](https://leetcode.cn/problems/remove-element/submissions/394409513/)
|
||||
|
||||

|
Reference in New Issue
Block a user