1.5k 1 分鐘

⭐️⭐️⭐️ # 題目敘述 Alice has n balloons arranged on a rope. You are given a 0-indexed string colors where colors[i] is the color of the ith balloon. Alice wants the rope to be colorful. She does not want two consecutive balloons to be of the same color, so she asks Bob for help. Bob can remove some...
950 1 分鐘

⭐️ # 題目敘述 You are given a string s consisting only of the characters '0' and '1' . In one operation, you can change any '0' to '1' or vice versa. The string is called alternating if no two adjacent characters are equal. For example, the string "010"...
1k 1 分鐘

⭐️ # 題目敘述 You are given an integer array prices representing the prices of various chocolates in a store. You are also given a single integer money , which represents your initial amount of money. You must buy exactly two chocolates in such a way that you still have some non-negative leftover money....
2.6k 2 分鐘

ChienI Kao 筆記網站 JHTNT 筆記網站 # 題目 Floyd-Warshall 演算法 wiki 撰寫出 Floyd-Warshall 演算法,處理點到點的最短路徑 # 單機版程式 #include <bits/stdc++.h>#define N 1000using namespace std;int main() { srand(36); long start = clock(); int **D; D = (int **)malloc(N * sizeof(int *)); for (int i = 0; i <...
892 1 分鐘

⭐️ # 題目敘述 The product difference between two pairs (a, b) and (c, d) is defined as (a * b) - (c * d) . For example, the product difference between (5, 6) and (2, 7) is (5 * 6) - (2 * 7) = 16 . Given an integer array nums , choose four distinct indices w , x , y , and z such that the product...
4.2k 4 分鐘

⭐️⭐️⭐️ # 題目敘述 Design a food rating system that can do the following: Modify the rating of a food item listed in the system. Return the highest-rated food item for a type of cuisine in the system. Implement the FoodRatings class: FoodRatings(String[] foods, String[] cuisines, int[] ratings)...
678 1 分鐘

⭐️ # 題目敘述 Given two strings s and t , return true if t is an anagram of s , and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. # Example 1 Input: s = "anagram",...
394 1 分鐘

ChienI Kao 筆記網站 JHTNT 筆記網站 Virtual Private Network (VPN) 虛擬私人網路 使用 VPN 可在電腦和 VPN 提供者的伺服器之間建立一條安全的、加密的通道。 在電腦和 VPN 提供者的伺服器之間建立數位連線,形成點對點通道,可加密個人資料,同時遮罩 IP 位址,在網際網路上能夠跨越網站封鎖和防火牆的限制,使用 VPN 確保連線體驗更為私人、受保護且更安全。 VPN 提供了一種安全、私密且匿名的連線方式,特別適合需要在不受信任的網路環境中保護敏感資料的情況。 Virtual: 連線過程未涉及實體纜線 Private:...
1.7k 2 分鐘

⭐️ # 題目敘述 You are given the array paths , where paths[i] = [cityAi, cityBi] means there exists a direct path going from cityAi to cityBi . Return the destination city, that is, the city without any path outgoing to another city. It is guaranteed that the graph of paths forms a line without any loop,...
298 1 分鐘

ChienI Kao 筆記網站 JHTNT 筆記網站 # 簡介 Linux Linux 是一種作業系統的核心,有時候的 Linux 也被稱為基於 Linux 的完整作業系統,如: Ubuntu、CentOS、Debian、Gentoo,作業系統除了 Linux 核心外,其中也包含了許多使用者圖形介面和其他實用工具。 # Linux 開機流程 # BIOS / UEFI # GPT / MBR # GRUB # vmlinuz # initramfs / initrd # systemd # Linux 工具 # 文字編輯器 # Shell Scripts # Tmux # NFS #...