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

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

LeetCode Biweekly Contest 89

Biweekly Contest 89 2423. Remove Letter To Equalize Frequency You are given a 0-indexed string word, consisting of lowercase English letters. You need to select one index and remove the letter at that index from word so that the frequency of every letter present in word is equal. Return true if it is possible to remove one letter so that the frequency of all letters in word are equal, and false otherwise....

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