DAY 24 試題
問題描述
給定一個由不同整數組成的陣列 candidates 和一個目標整數 target,返回所有數字組合的清單,使得每組數字的和等於...
昨天我們講到 collections 模組,今天我們來介紹 collections 模組中的 deque:double-ended queue,也就是雙端佇列。...
解題程式碼
var pathSum = function (root, targetSum) {
if (!root) return [];
const...
題目:
這題要求在給定的字串中找到第一個不重複的字元,並回傳它的索引。如果不存在不重複字元,則回傳 -1。
解題思路
使用 hasp map (unordere...
小小知識
什麼是 robots.txt?robots.txt 是一個放在網站根目錄中的簡單文本檔案,用於指導網路爬蟲(如 Googlebot)哪些頁面應該抓取,...
338. Counting Bits
tags: Easy、Bitwise
Given an integer n, return an array ans o...