2022 Advent of Code Day 1

Day 1: Calorie Counting

2023, January 1 · 1 min · 22 words · Me

LeetCode Biweekly Contest 90

Biweekly Contest 90 tags: leetcode contest Biweekly Contest 90 Problem list Score 2451. Odd String Difference 3 ✅ 2452. Words Within Two Edits of Dictionary 4 ✅ 2453. Destroy Sequential Targets 5 ✅ 2454. Next Greater Element IV 6 2451. Odd String Difference You are given an array of equal-length strings words. Assume that the length of each string is n. Each string words[i] can be converted into a difference integer array difference[i] of length n - 1 where difference[i][j] = words[i][j+1] - words[i][j] where 0 <= j <= n - 2....

2022, October 31 · 6 min · 1211 words · Me

LeetCode Weekly Contest 316

Weekly Contest 316 tags: leetcode contest Weekly Contest 316 Problem list Score Determine if Two Events Have Conflict 3 ✅ Number of Subarrays With GCD Equal to K 4 ✅ Minimum Cost to Make Array EqualConflict 6 Minimum Number of Operations to Make Arrays Similar 6 2446. Determine if Two Events Have Conflict You are given two arrays of strings that represent two inclusive events that happened on the same day, event1 and event2, where:...

2022, October 25 · 3 min · 534 words · Me

Minesweeper

順便推坑一下踩地雷 連結 (https://minesweeper.online/tw/game/1390423794) Description In the popular Minesweeper game you have a board with some mines and those cells that don’t contain a mine have a number in it that indicates the total number of mines in the neighboring cells. Starting off with some arrangement of mines we want to create a Minesweeper game setup. Example For 1 2 3 matrix = [[true, false, false], [false, true, false], [false, false, false]] the output should be...

2022, October 22 · 2 min · 419 words · Me

LeetCode Weekly Contest 313

Weekly Contest 313 2427. Number of Common Factors Given two positive integers a and b, return the number of common factors of a and b. An integer x is a common factor of a and b if x divides both a and b. Constraints: 1 <= a, b <= 1000 給定正整數a, b,回傳他們的公因數的數量 條件: 1 <= a, b <= 1000 想法: x 從 1 開始到 min(a,b),如果 a 可以被 x 整除 且 b 可以被 x 整除,x 即為 (a,b) 的公因數...

2022, October 3 · 2 min · 415 words · Me