LeetCode: 70-Climbing Stairs 解題紀錄
題目
You are climbing a staircase. It takes n
steps to reach the top.
Each time you can either climb 1
or 2
steps. In how many distinct ways can you climb to the top?
You are climbing a staircase. It takes n
steps to reach the top.
Each time you can either climb 1
or 2
steps. In how many distinct ways can you climb to the top?
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.
Read More »LeetCode: 124-Binary Tree Maximum Path Sum 解題紀錄本文僅翻譯、整理官方文檔關於此章節的內容,不會有太多專業的敘述,僅僅是個開場白的介紹;更詳細的 Textbook 翻譯可以參考本文文末的 Read More 連結。
Read More »[Qiskit] 量子計算(Quantum Computing)基本介紹 - IntroductionGiven the root
of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is maximized.
Given the root
of a binary tree, find the maximum value v
for which there exist different nodes a
and b
where v = |a.val - b.val|
and a
is an ancestor of b
.
『量子物理學』(quantum physics)是一個廣泛應用但鮮為人知的術語。簡單來說,量子物理學是一個描述微觀世界中粒子如何運動的數學模型。
Read More »[Qiskit] 什麼是量子(Quantum)?Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence.
Read More »LeetCode: 872-Leaf-Similar Trees 解題紀錄Given the head
of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list.
Given the head
of a singly linked list, return the middle node of the linked list.
If there are two middle nodes, return the second middle node.
Read More »LeetCode: 876-Middle of the Linked List 解題紀錄You are given a 0-indexed integer array nums
of length n
.
The average difference of the index i
is the absolute difference between the average of the first i + 1
elements of nums
and the average of the last n - i - 1
elements. Both averages should be rounded down to the nearest integer.