856 1 分鐘

⭐️ # 題目敘述 Given two integer arrays nums1 and nums2 , return an array of their intersection. Each element in the result must be unique and you may return the result in any order. # Example 1 Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2] # Example 2 Input: nums1 = [4,9,5], nums2 =...
889 1 分鐘

⭐️ # 題目敘述 Given two integer arrays nums1 and nums2 , sorted in non-decreasing order, return the minimum integer common to both arrays. If there is no common integer amongst nums1 and nums2 , return -1 . Note that an integer is said to be common to nums1 and nums2 if both arrays have at least one...
4.3k 4 分鐘

ChienI Kao 筆記網站 JHTNT 筆記網站 # What is Makefile? 在開始介紹 Makefile 語法前,我們先來了解一下到底什麼是 Make,而 Makefile 又是什麼? make 是一個指令,它會讀取 makefile 檔案中的內容,自動化編譯軟體。 makefile 是一個檔案,它描述了軟體的編譯規則。 簡單來說,make 和 makefile 的關係就像是廚師和食譜: make 是廚師,負責按照食譜(makefile)烹飪(編譯)軟體。 makefile...
962 1 分鐘

⭐️ # 題目敘述 You are given an array nums consisting of positive integers. Return the total frequencies of elements in nums such that those elements all have the maximum frequency. The frequency of an element is the number of occurrences of that element in the array. # Example 1 Input: nums =...
1k 1 分鐘

⭐️ # 題目敘述 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. # Example 1 Input: head = [1,2,3,4,5] Output: [3,4,5] Explanation: The middle node of the list is node 3. # Example 2 Input: head =...
1.8k 2 分鐘

⭐️⭐️⭐️ # 題目敘述 You start with an initial power of power , an initial score of 0 , and a bag of tokens given as an integer array tokens , where each tokens[i] donates the value of tokeni. Your goal is to maximize the total score by strategically playing these tokens. In one move, you can play an...
1.4k 1 分鐘

⭐️⭐️⭐️ # 題目敘述 There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from city fromi to city toi with cost pricei . You are also given three integers src , dst , and k , return the cheapest price...
1.5k 1 分鐘

⭐️ # 題目敘述 In a town, there are n people labeled from 1 to n . There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody. Everybody (except for the town judge) trusts the town judge. There is exactly one person that satisfies...
453 1 分鐘

⭐️⭐️⭐️ # 題目敘述 Given two integers left and right that represent the range [left, right] , return the bitwise AND of all numbers in this range, inclusive. # Example 1 Input: left = 5, right = 7 Output: 4 # Example 2 Input: left = 0, right = 0 Output: 0 # Example 3 Input: left = 1, right =...
836 1 分鐘

⭐️ # 題目敘述 Given an array nums containing n distinct numbers in the range [0, n] , return the only number in the range that is missing from the array. # Example 1 Input: nums = [3,0,1] Output: 2 Explanation: n = 3 since there are 3 numbers, so all numbers are in the range [0,3]. 2 is the missing...