LeetCode: 1071-Greatest Common Divisor of Strings 解題紀錄
題目
For two strings s
and t
, we say "t
divides s
" if and only if s = t + ... + t
(i.e., t
is concatenated with itself one or more times).
For two strings s
and t
, we say "t
divides s
" if and only if s = t + ... + t
(i.e., t
is concatenated with itself one or more times).
Hydra是一個開源的 Python 框架,它被設計用來簡化研發佈署的流程(尤其是在複雜的應用上)。Hydra 能夠在佈署時動態地建立階層式的設定檔案、也透過命令列(command line)來繼承(複寫)設定檔。
Read More »Hydra 環境配置管理套件筆記Given an undirected tree consisting of n
vertices numbered from 0
to n-1
, which has some apples in their vertices. You spend 1 second to walk over one edge of the tree. Return the minimum time in seconds you have to spend to collect all apples in the tree, starting at vertex 0 and coming back to this vertex.
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.
Read More »LeetCode: 100-Same Tree 解題紀錄You are given a 0-indexed integer array tasks
, where tasks[i]
represents the difficulty level of a task. In each round, you can complete either 2 or 3 tasks of the same difficulty level.
在前一篇文章,我們了解了一個量子位元可能的機率狀態。我們將把量子位元表達成二維向量,並限制寫成以下格式。
Read More »[Qiskit] 單量子位元閘(Single Qubit Gates)You are given an array of n
strings strs
, all of the same length.
Given a directed acyclic graph (DAG) of n
nodes labeled from 0
to n - 1
, find all possible paths from node 0
to node n - 1
and return them in any order.
You have n
bags numbered from 0
to n - 1
. You are given two 0-indexed integer arrays capacity
and rocks
. The ith
bag can hold a maximum of capacity[i]
rocks and currently contains rocks[i]
rocks. You are also given an integer additionalRocks
, the number of additional rocks you can place in any of the bags.