原文題目Given an array of integers nums and an integer k, return the total number of subarrays whose sum...
有位台灣人小哥(算是朋友的前同事),幾年前蓋了一個小工具叫 「Online Tools」(https://emn178.github.io/online-tools/)。今天就利用這個網站,簡單操作幾...
242. Valid Anagram 給定兩個字串 s 和 t,判斷 t 是否為 s 的Anagram。Anagram 是指兩個字串中出現的字母相同,且每個字母的出現次數也相同,但順序可以不同。 簡單...
原文題目Given an unsorted array of integers nums, return the length of the longest consecutive elements...
數位簽章的 sign 和 verify 裡面都有把訊息(message)雜湊(hash)起來的雜湊函式。雜湊函數(hash functions)與資料完整性(data integrity)可以怎麼理解...
Hash 函數 Hash 函數是一種將任意長度的輸入轉換為固定長度輸出的算法,輸出被稱為哈希值(hash value)。好的哈希函數具有以下特性: 不可逆性:給定輸出,幾乎不可能反推出輸入。 抗...
350. Intersection of Two Arrays II 給定兩個整數數組 nums1 和 nums2,返回兩個數組的交集。輸出結果中的每個元素應該與其在兩個數組中出現的次數一致(也就是交...
原文題目 Given an array of strings strs, group the anagrams together. You can return the answer in any o...
217. Contains Duplicate 給定一個整數數組 nums,判斷其中是否存在重複元素。如果任意數字在數組中出現至少兩次,返回 true;如果所有元素互不相同,則返回 false。 程式...
Hash 學習影片 https://www.youtube.com/watch?v=eH5ihbNHD70https://www.youtube.com/watch?v=O4dGJZ4J0Bk Has...