2025年3月

[Leetcode] 1804. Implement Trie II

A trie (pronounced as “try”) or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker.

Implement the Trie class:

Trie() Initializes the trie object.
void insert(String word) Inserts the string word into the trie.
int countWordsEqualTo(String word) Returns the number of instances of the string word in the trie.
int countWordsStartingWith(String prefix) Returns the number of strings in the trie that have the string prefix as a prefix.
void erase(String word) Erases the string word from the trie.

[Leetcode] 1804. Implement Trie II 阅读更多 ”

Leetcode, 技术文章

[LeetCode] 0020. Valid Parentheses

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

An input string is valid if:

Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Every close bracket has a corresponding open bracket of the same type.

[LeetCode] 0020. Valid Parentheses 阅读更多 ”

Leetcode, 技术文章
当AI 写程式比你还快,工程师该如何找到自己的新定位?

当AI 写程式比你还快,工程师该如何找到自己的新定位?

试想一下这样的场景:你坐在电脑前,描述出你心中所想的功能,几秒后,人工智慧便为你产出一段可以运行的程式码,甚至整个应用程式就此诞生。听起来是不是有些魔法感?
这个场景早已不是天方夜谭,而是正在发生的现实。近几年AI coding 技术快速崛起,逐渐从技术新闻中的新奇话题,转变成日常开发工作的重要工具。从GitHub Copilot 到DeepSeek R1,人工智慧不仅改变了程式设计的方式,更可能颠覆整个软体产业的发展方向。
那么AI coding 技术究竟发展到了什么程度?它会不会取代工程师的工作?身为科技从业人员,我们又该如何面对这波科技浪潮?本文将从AI coding 的起源、现况、实际应用、对产业影响、未来发展,以及科技业人员应对之道,逐步深入解析。

当AI 写程式比你还快,工程师该如何找到自己的新定位? 阅读更多 ”

软体工程师,

[Leetcode] 0211. Design Add and Search Words Data Structure

Design a data structure that supports adding new words and finding if a string matches any previously added string.

Implement the WordDictionary class:

WordDictionary() Initializes the object.
void addWord(word) Adds word to the data structure, it can be matched later.
bool search(word) Returns true if there is any string in the data structure that matches word or false otherwise. word may contain dots '.' where dots can be matched with any letter.

[Leetcode] 0211. Design Add and Search Words Data Structure 阅读更多 ”

Leetcode, 技术文章

[Leetcode] 0208. Implement Trie

A trie (pronounced as “try”) or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker.

Implement the Trie class:

Trie() Initializes the trie object.
void insert(String word) Inserts the string word into the trie.
boolean search(String word) Returns true if the string word is in the trie (ie, was inserted before), and false otherwise.
boolean startsWith(String prefix) Returns true if there is a previously inserted string word that has the prefix prefix, and false otherwise.

[Leetcode] 0208. Implement Trie 阅读更多 ”

Leetcode, 技术文章

[Leetcode] 0235. Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.

According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”

[Leetcode] 0235. Lowest Common Ancestor of a Binary Search Tree 阅读更多 ”

Leetcode, 技术文章

[Leetcode] 0098. Validate Binary Search Tree

Given the root of a binary tree, determine if it is a valid binary search tree (BST).

A valid BST is defined as follows:

The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only nodes with keys greater than the node's key.
Both the left and right subtrees must also be binary search trees.

[Leetcode] 0098. Validate Binary Search Tree 阅读更多 ”

Leetcode, 技术文章
zh_CN简体中文