Python
LeetCode: 2244-Minimum Rounds to Complete All Tasks 解題紀錄
題目
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.
[Qiskit] 單量子位元閘(Single Qubit Gates)
在前一篇文章,我們了解了一個量子位元可能的機率狀態。我們將把量子位元表達成二維向量,並限制寫成以下格式。
Read More »[Qiskit] 單量子位元閘(Single Qubit Gates)LeetCode: 944-Delete Columns to Make Sorted 解題紀錄
題目
You are given an array of n
strings strs
, all of the same length.
LeetCode: 797-All Paths From Source to Target 解題紀錄
題目
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.
LeetCode: 2279-Maximum Bags With Full Capacity of Rocks 解題紀錄
題目
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.
LeetCode: 55-Jump Game 解題紀錄
題目
You are given an integer array nums
. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position.
LeetCode: 309-Best Time to Buy and Sell Stock with Cooldown 解題紀錄
題目
You are given an array prices
where prices[i]
is the price of a given stock on the ith
day.
LeetCode: 841-Keys and Rooms 解題紀錄
題目
There are n
rooms labeled from 0
to n - 1
and all the rooms are locked except for room 0
. Your goal is to visit all the rooms. However, you cannot enter a locked room without having its key.
[Qiskit] 量子位元狀態的表示法
前一個章節我們使用 Qiskit 實作了一個半加法器(Half Adder)。現在,我們已經知道了什麼是『位元』(bits)、以及傳統電腦的部分工作原理。
Read More »[Qiskit] 量子位元狀態的表示法