Home
Zone's blog
Cancel

Leetcode 143 重排链表

题目概述 Leetcode 143 You are given the head of a singly linked-list. The list can be represented as: [L_0 \rightarrow L_1 \rightarrow \cdots \rightarrow L_{n - 1} \rightarrow L_n] Reorder the list...

Preview Image

上海之旅

行程 Day1 上海站 $\rightarrow$ 午餐 $\rightarrow$ 城隍庙、豫园 $\rightarrow$ 晚餐 $\rightarrow$ 休息 Day2 午餐 $\rightarrow$ 上海自然博物馆 $\rightarrow$ 南京路购物 $\rightarrow$ 晚餐 $\rightarrow$ 休息 Day3 午餐 $\rightarrow...

三月碎碎念

记录一些心中淤积的烦恼以及从中获得的一些感悟。 其一 感觉自己是一个脑子里装着理想主义的大半个空想家;但同时又很难不在意世俗眼光的矛盾结合体。 其二 我想我活了24年,至今也没有学会如何爱自己。 可以说,我对待自己是双标的,有些事情上对自己的要求过于苛刻,而在另一些事情上又会放任纵容自己。与此同时,我也能意识到这种不自洽,也时常因此陷入自我斗争中,始终无法真正地接纳自己。 这带来的最严...

Leetcode 300 最长递增子序列

题目概述 Leetcode 2812 Given an integer array nums, return the length of the longest strictly increasing subsequence. A subsequence is an array that can be derived from another array by deleting som...

Leetcode 2812 找出最安全路径

题目概述 Leetcode 2812 You are given a 0-indexed 2D matrix grid of size n x n, where (r, c) represents: A cell containing a thief if grid[r][c] = 1 An empty cell if grid[r][c] = 0 You are ini...

Leetcode 1457 二叉树中的伪回文路径

题目概述 Leetcode 1457 Given a binary tree where node values are digits from 1 to 9. A path in the binary tree is said to be pseudo-palindromic if at least one permutation of the node values in the p...

大语言模型开发实践 之 基于个人知识库的问答助手

准备工作 读取OpenAI的API key 获取API key的过程在此省略,具体内容可以参照 这里 。将获取的key保存到项目根目录下的.env文件中,存储方式如下: OPENAI_API_KEY = <your key> 在后续项目代码中读取key的方式如下: import os import openai from dotenv import load_dote...

Leetcode 1611 使整数变为0的最少操作次数

题目概述 Leetcode 1611 Given an integer n, you must transform it into 0 using the following operations any number of times: Change the rightmost (0th) bit in the binary representation of n. Chan...

Java集合框架 之 Map接口

Map接口有以下几个常见的实现类: HashMap 构造方法 常用方法 遍历方式 LinkedHashMap TreeMap 构造方法 常用方法 HashTable 参考 HashMap 元素为键值对,键具有唯一性。 JDK 1.8中基于位桶 + 链...

Java集合框架 之 Set接口

特点: 元素无序,不可重复。包含以下几个常用的实现类: Hashset 构造方法 常用方法 遍历方式 关于无序性 LinkedHashSet 构造方法 常用方法 遍历方式 关于有序性 TreeSet 构造方法 ...

PageView: