欢迎来到软体技术部落格,这里是 React、JavaScript 及技术技能的知识文章页面。无论是在寻找关于monorepo 的技术、zustand 的状态管理技巧,还是希望加强对前端开发的理解,这里都有丰富的资源。每篇文章都精心撰写,旨在提供清晰、易于理解的内容,帮助大家快速找到所需资讯。从基本概念到进阶技巧,无论是初学或是进阶,这里都有适合大家的内容。如果对于图文式内容有兴趣,也可以参考我们 Instagram。
🤖 你敢用AI 员工吗?一场由Google Gemini 主演的企业实习体验
当一家中小企业开始扩张,第一个难题通常不是市场或产品,而是人手不够。想像今天你就是这间企业的负责人,你可能需要身兼三职:回覆客户、写文案、同时处理顾客评论。
而在这些繁琐但重要的任务中,你开始听到一种可能改变你工作方式的新帮手:AI 人工智慧,或更具体地说:大型语言模型(Large Language Model, LLM)。
[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] 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.
当AI 写程式比你还快,工程师该如何找到自己的新定位?
试想一下这样的场景:你坐在电脑前,描述出你心中所想的功能,几秒后,人工智慧便为你产出一段可以运行的程式码,甚至整个应用程式就此诞生。听起来是不是有些魔法感?
这个场景早已不是天方夜谭,而是正在发生的现实。近几年AI coding 技术快速崛起,逐渐从技术新闻中的新奇话题,转变成日常开发工作的重要工具。从GitHub Copilot 到DeepSeek R1,人工智慧不仅改变了程式设计的方式,更可能颠覆整个软体产业的发展方向。
那么AI coding 技术究竟发展到了什么程度?它会不会取代工程师的工作?身为科技从业人员,我们又该如何面对这波科技浪潮?本文将从AI coding 的起源、现况、实际应用、对产业影响、未来发展,以及科技业人员应对之道,逐步深入解析。
[Leetcode] 0212. Word Search II
Given an mxn board of characters and a list of strings words, return all words on the board.
Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.
[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] 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] 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] 0230. Kth Smallest Element in a BST
Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree.
[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] 0105. Construct Binary Tree from Preorder and Inorder Traversal
Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree.
[Leetcode] 0572. Subtree of Another Tree
Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise.
A subtree of a binary tree tree is a tree that consists of a node in tree and all of this node's descendants. The tree tree could also be considered as a subtree of itself.
[Leetcode] 0297. Serialize and Deserialize Binary Tree
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.
Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure.
Clarification: The input/output format is the same as how LeetCode serializes a binary tree. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.
美国半导体战略大转变!台积电1650 亿美元投资会如何改写晶片市场?
台湾积体电路制造公司(TSMC,以下称台积电)近日宣布将在美国设立第三座晶圆厂,并计划投资1650 亿美元,在亚利桑那州建设先进封装工厂及研发中心。这项重大投资不仅是台积电的商业扩展策略之一,更与国际政策和经济发展息息相关。
这项投资将对全球晶片市场产生何种影响?台积电加码美国到底有什么利弊?对台湾的经济与区域安全会带来哪些冲击?今天就来深入分析这项重大决策,并聊聊这个策略会对科技业产生什么样的改变!
[Leetcode] 0102. Binary Tree Level Order Traversal
Given the root of a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
[Leetcode] 0124. Binary Tree Maximum Path Sum
A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root.
The path sum of a path is the sum of the node's values in the path.
Given the root of a binary tree, return the maximum path sum of any non-empty path.
[Leetcode] 0951. Flip Equivalent Binary Trees
For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees.
A binary tree X is flip equivalent to a binary tree Y if and only if we can make X equal to Y after some number of flip operations.
Given the roots of two binary trees root1 and root2, return true if the two trees are flip equivalent or false otherwise.
[Leetcode] 0100. Same Tree
Given the roots of two binary trees p and q, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.
[Leetcode] 0271. Encode and Decode Strings
Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings.
[Leetcode] 0647. Palindromic Substrings
Given a string s, return the number of palindromic substrings in it.
A string is a palindrome when it reads the same backward as forward.
A substring is a contiguous sequence of characters within the string.