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 Read More »

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 Read More »

Leetcode, 技術文章
當 AI 寫程式比你還快,工程師該如何找到自己的新定位?

當 AI 寫程式比你還快,工程師該如何找到自己的新定位?

試想一下這樣的場景:你坐在電腦前,描述出你心中所想的功能,幾秒後,人工智慧便為你產出一段可以運行的程式碼,甚至整個應用程式就此誕生。聽起來是不是有些魔法感?
這個場景早已不是天方夜譚,而是正在發生的現實。近幾年 AI coding 技術快速崛起,逐漸從技術新聞中的新奇話題,轉變成日常開發工作的重要工具。從 GitHub Copilot 到 DeepSeek R1,人工智慧不僅改變了程式設計的方式,更可能顛覆整個軟體產業的發展方向。
那麼 AI coding 技術究竟發展到了什麼程度?它會不會取代工程師的工作?身為科技從業人員,我們又該如何面對這波科技浪潮?本文將從 AI coding 的起源、現況、實際應用、對產業影響、未來發展,以及科技業人員應對之道,逐步深入解析。

當 AI 寫程式比你還快,工程師該如何找到自己的新定位? Read More »

軟體工程師,

[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 Read More »

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 (i.e., 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 Read More »

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 Read More »

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 Read More »

Leetcode, 技術文章
zh_TW繁體中文