Problem https://leetcode.com/contest/weekly-contest-362/problems/minimum-moves-to-spread-stones-over-grid/ Solution z := len([True for row in grid for num in row if num == 0]) Time Complexity: O(z!) S ...
Problem https://leetcode.com/contest/weekly-contest-362/problems/determine-if-a-cell-is-reachable-at-a-given-time/ Testcases # Input Expected 1 1 1 1 1 3 True 2 1 2 1 2 1 False 3 1 3 1 3 0 True 4 1 1 ...
Problem https://leetcode.com/contest/weekly-contest-362/problems/points-that-intersect-with-cars/ 相關例題 Leetcode # 56. ⭐️ Merge Intervals Solution Time Complexity: O(len(nums)) Space Complexity: O(1) ( ...
Problem https://leetcode.com/problems/merge-intervals Solution Time Complexity: O(len(intervals)) Space Complexity: O(1) (The input and output generally do not count towards the space complexity.) cla ...
Problem https://leetcode.com/contest/weekly-contest-361/problems/minimum-operations-to-make-a-special-number/ Solution Time Complexity: O(len(num)) Space Complexity: O(1) (The input and output general ...
Problem https://leetcode.com/contest/weekly-contest-361/problems/count-symmetric-integers/ Solution 三位數(ex: 0303)不算 Time Complexity: O(1) Space Complexity: O(1) (The input and output generally do not ...
Problem https://leetcode.com/problems/permutation-in-string Solution: Sliding Window First Solution Time Complexity: O(len(s2)) Space Complexity: O(26) ≡ O(1) (The input and output generally do not co ...
Problem https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element 相關例題 Leetcode # 487. Max Consecutive Ones II Solution: Sliding Window Time Complexity: O(len(nums)) Space Comple ...
Problem https://leetcode.com/problems/maximize-the-confusion-of-an-exam Solution: Sliding Window Time Complexity: O(len(answerKey)) Space Complexity: O(1) (The input and output generally do not count ...
Problem https://leetcode.com/problems/number-of-sub-arrays-of-size-k-and-average-greater-than-or-equal-to-threshold Solution: Sliding Window First Solution Time Complexity: O(len(arr)) Space Complexit ...